refactoring code
This commit is contained in:
@@ -138,6 +138,17 @@ public class User {
|
||||
return (permissions & permission) > 0;
|
||||
}
|
||||
|
||||
public static User load(String email) throws SQLException {
|
||||
var rs = Database.open().select(TABLE_NAME).where(EMAIL,email).compile().exec();
|
||||
try {
|
||||
if (rs.next()) {
|
||||
return User.from(rs);
|
||||
}
|
||||
return null;
|
||||
} finally {
|
||||
rs.close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the list of all users. Internally calls loadAll(null)
|
||||
|
||||
Reference in New Issue
Block a user