Permalink
Browse files

- UserDao.getPersonById returns correct value

  • Loading branch information...
1 parent 57e935b commit fc5e41d66d2bdeea1848eac5bfd4cb7f5fc15a03 @alexbiehl alexbiehl committed Mar 23, 2013
Showing with 2 additions and 4 deletions.
  1. +2 −4 src/main/java/org/fhw/asta/kasse/server/dao/UserDao.java
@@ -34,10 +34,8 @@ public boolean exists(String ldapName) {
return res > 0;
}
public Optional<Person> getPersonById(final String ldapName) {
- return Optional.fromNullable(this.template.queryForObject(
- "SELECT p1.* FROM person p1 WHERE p1.ldap_name = ? AND p1.revision ="
- + "(SELECT MAX(p2.revision) FROM person p2 WHERE p2.ldap_name = p1.ldap_name)", new Object[]{ldapName},
- new PersonRowMapper()));
+ return queryForObject("SELECT p1.* FROM person p1 WHERE p1.ldap_name = ? AND p1.revision ="
+ + "(SELECT MAX(p2.revision) FROM person p2 WHERE p2.ldap_name = p1.ldap_name)", new Object[]{ldapName}, new PersonRowMapper());
}
public Optional<Person> getPersonByIdAndRevision(String ldapName, int revision) {

0 comments on commit fc5e41d

Please sign in to comment.