Search in sources :

Example 11 with Group

use of com.ramussoft.net.common.Group in project ramus by Vitaliy-Yakovchuk.

the class UserFactoryImpl method createUser.

private User createUser(PreparedStatement groups, ResultSet rs, PreparedStatement groupQualifiers) throws SQLException {
    User user = new User();
    user.setName(rs.getString("name").trim());
    String login = rs.getString("login").trim();
    user.setLogin(login);
    user.setPassword(rs.getString("password").trim());
    groups.setString(1, login);
    ResultSet grs = groups.executeQuery();
    while (grs.next()) {
        Group group = new Group();
        group.setName(grs.getString("group_name").trim());
        fillGroup(group, groupQualifiers);
        user.getGroups().add(group);
    }
    grs.close();
    return user;
}
Also used : Group(com.ramussoft.net.common.Group) User(com.ramussoft.net.common.User) ResultSet(java.sql.ResultSet)

Aggregations

Group (com.ramussoft.net.common.Group)11 User (com.ramussoft.net.common.User)7 AccessRules (com.ramussoft.common.AccessRules)1 Qualifier (com.ramussoft.common.Qualifier)1 UserProvider (com.ramussoft.net.common.UserProvider)1 ActionEvent (java.awt.event.ActionEvent)1 PropertyChangeEvent (java.beans.PropertyChangeEvent)1 PropertyChangeListener (java.beans.PropertyChangeListener)1 File (java.io.File)1 FileOutputStream (java.io.FileOutputStream)1 IOException (java.io.IOException)1 OutputStream (java.io.OutputStream)1 PrintStream (java.io.PrintStream)1 ResultSet (java.sql.ResultSet)1 Calendar (java.util.Calendar)1 ResourceBundle (java.util.ResourceBundle)1 AbstractAction (javax.swing.AbstractAction)1 ImageIcon (javax.swing.ImageIcon)1 AbstractTableModel (javax.swing.table.AbstractTableModel)1 GrantedAuthority (org.acegisecurity.GrantedAuthority)1