@ SuppressWarnings ( "unchecked" ) public LdapUser getLdapUser ( final String username ) { final Query query = pm . newQuery ( LdapUser . class , "username == :username" ) ; final List < LdapUser > result = ( List < LdapUser > ) query . execute ( username ) ; return Collections . isEmpty ( result ) ? null : result . get ( 0 ) ; }
Retrieves an LdapUser containing the specified username . If the username does not exist returns null .