Added lookupUsersByEmail() to look up all user records for users that

match the specified email address.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@1507 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
ray
2004-09-25 01:52:17 +00:00
parent b34c1a3265
commit 6a0f89d645
@@ -268,6 +268,28 @@ public class UserRepository extends JORARepository
});
}
/**
* Lookup a user by email address, something that is not efficient and
* should really only be done by site admins attempting to look up a
* user record.
*
* @return the user with the specified user id or null if no user with
* that id exists.
*/
public ArrayList lookupUsersByEmail (String email)
throws PersistenceException
{
final String where = "where email = '" +
StringUtil.replace(email, "'", "\\'") + "'";
return (ArrayList) execute(new Operation() {
public Object invoke (Connection conn, DatabaseLiaison liaison)
throws PersistenceException, SQLException
{
return _utable.select(where).toArrayList();
}
});
}
/**
* Loads up a user record that matches the specified where clause.
* Returns null if no record matches.