Subversion Repositories general

Compare Revisions

Ignore whitespace Rev 922 → Rev 923

/sun/hostcaptain/trunk/src/ak/hostcaptain/core/model/UserManager.java
68,6 → 68,28
return user;
}
 
public boolean loginExists(User editor, User user, String login)
throws ModelException
{
try {
if(user.getId() == null)
return ((Integer)HibernateUtil.currentSession().iterate(
"select count(*) from User u where login = ?",
login, Hibernate.STRING)
.next()).intValue() > 0;
else
return ((Integer)HibernateUtil.currentSession().iterate(
"select count(*) from User u where login = ? and u != ?",
new Object[] { login, user },
new Type[] { Hibernate.STRING, Hibernate.entity(User.class) } )
.next()).intValue() > 0;
}
catch(HibernateException ex)
{
throw new ModelException(ex);
}
}
 
public User findForLogin(String login)
throws ModelException
{
141,7 → 163,7
}
}
 
public boolean areSystemUsersAvailable(User editor)
public boolean areUsersAvailable(User editor)
throws ModelException
{
try {
150,7 → 172,7
}
else {
return ((Integer)HibernateUtil.currentSession().iterate(
"from User u where u = ? or u.boss = ?",
"select count(*) from User u where u = ? or u.boss = ?",
new Object[] { editor, editor},
new Type[] { Hibernate.entity(User.class), Hibernate.entity(User.class) } )
.next()).intValue() > 0;