refactoring code

This commit is contained in:
2022-04-20 09:21:45 +02:00
parent b38b40a677
commit 2c99aa20b3
8 changed files with 199 additions and 128 deletions

View File

@@ -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)