Permalink
Browse files

- exists query optimization

  • Loading branch information...
1 parent fc5e41d commit ff5ebf885b37db6c1675b38d08cc0f9bc69fbc0e @alexbiehl alexbiehl committed Mar 23, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/main/java/org/fhw/asta/kasse/server/dao/UserDao.java
@@ -30,7 +30,7 @@ public Person mapRow(ResultSet arg0, int arg1) throws SQLException {
}
public boolean exists(String ldapName) {
- final int res = template.queryForInt("SELECT COUNT(0) FROM person WHERE ldap_name = ?", new Object[]{ ldapName });
+ final int res = template.queryForInt("SELECT COUNT(0) FROM person WHERE ldap_name = ? LIMIT 1", new Object[]{ ldapName });
return res > 0;
}
public Optional<Person> getPersonById(final String ldapName) {

0 comments on commit ff5ebf8

Please sign in to comment.