Subversion Repositories general

Compare Revisions

Ignore whitespace Rev 26 → Rev 27

/kickup/trunk/src/ak/kickup/core/model/ParticipantManager.java
27,6 → 27,8
try {
HibernateUtil.getConfiguration().addResource(
"ak/kickup/core/model/Participant.hbm.xml");
HibernateUtil.getConfiguration().addResource(
"ak/kickup/core/model/ParticipantAct.hbm.xml");
 
participantManager = new ParticipantManager();
}
82,6 → 84,30
}
}
 
public boolean emailExists(Participant participant, String email)
throws ModelException
{
try {
if(participant.getId() == null)
return ((Integer)HibernateUtil.currentSession().iterate(
"select count(*) from Participant where email=? and event=?",
new Object[] { email, participant.getEvent() },
new Type[] { Hibernate.STRING, Hibernate.entity(Event.class) } )
.next()).intValue() > 0;
else
return ((Integer)HibernateUtil.currentSession().iterate(
"select count(*) from Participant p where email=? and event=? and p!=?",
new Object[] { email, participant.getEvent(), participant },
new Type[] { Hibernate.STRING, Hibernate.entity(Event.class),
Hibernate.entity(Participant.class) } )
.next()).intValue() > 0;
}
catch(HibernateException ex)
{
throw new ModelException(ex);
}
}
 
public String generateIdent()
throws ModelException
{
172,6 → 198,12
}
}
 
public ParticipantAct createAct()
throws ModelException
{
return new ParticipantAct();
}
 
public static final Comparator NICK_COMPARATOR = new NickComparator();
 
private static class NickComparator