java.lang.Object
ru.cg.webbpm.modules.security.api.impl.dao.jooq.BaseDao<org.jooq.Record,User>
ru.cg.webbpm.modules.security.api.impl.dao.jooq.UserDao

@Repository public class UserDao extends BaseDao<org.jooq.Record,User>
Author:
latypov
  • Constructor Details

    • UserDao

      @Autowired public UserDao(OrgUnitDao orgUnitDao)
  • Method Details

    • createRecordMapper

      protected org.jooq.RecordMapper<org.jooq.Record,User> createRecordMapper()
      Creates user account record mapper.
      Specified by:
      createRecordMapper in class BaseDao<org.jooq.Record,User>
      Returns:
      new record mapper.
    • createEnrichedRecordMapper

      protected org.jooq.RecordMapper<org.jooq.Record,User> createEnrichedRecordMapper()
      Creates user account record mapper.
      Overrides:
      createEnrichedRecordMapper in class BaseDao<org.jooq.Record,User>
      Returns:
      new record mapper.
    • enriched

      protected User enriched(User user)
      Populates user instance by OrgUnit instance.
      Overrides:
      enriched in class BaseDao<org.jooq.Record,User>
      Parameters:
      user - User to populate by instance of OrgUnit.
      Returns:
      the same populated object or null.
    • getUser

      public User getUser(String userId)
      Gets user by user account id.
      Parameters:
      userId - user account id of object to receive. Instance of String type
      Returns:
      requested user or null if it does not exist. Instance of User type.
    • getUserByUsername

      public User getUserByUsername(String username, boolean loginCaseSensitive)
      Gets user by username.
      Parameters:
      username - username of user to receive. Instance of String type.
      Returns:
      requested user or null if does not exist. Instance of User type.
    • getUserSourceByUserId

      public UserSourceType getUserSourceByUserId(String userId)
    • getUserByEmail

      public User getUserByEmail(String email)
      Gets user by email.
      Parameters:
      email - user's email. Instance of String type.
      Returns:
      requested user or null if does not exist. Instance of User type.
    • getUserIdsByUsernameAndEmail

      public Set<String> getUserIdsByUsernameAndEmail(String username, String email)
      Gets user ids by username and email.
      Parameters:
      username - user's username. Instance of String type.
      email - user's email. Instance of String type.
      Returns:
      set of user ids. Instance of Set type.
    • getUserWithAccessLevelId

      public User getUserWithAccessLevelId(String accessLevelId)
      Gets any user with access level id.
      Parameters:
      accessLevelId - access level id of object to receive. Instance of String type.
      Returns:
      requested user or null if does not exist. Instance of User type.
    • getUserWithMaxAccessLevel

      public User getUserWithMaxAccessLevel()
      Gets any existing(not locked) user with max access level (maybe super admin)
      Returns:
      requested user or null if does not exist. Instance of User type.
    • getUsers

      public List<User> getUsers(LoadOptions options)
      Gets users according to load options.
      Parameters:
      options - indicates load option properties. Instance of LoadOptions type.
      Returns:
      list of users. Instance of List type.
    • getUsers

      public Collection<User> getUsers(Collection<String> userIds)
      Gets users by collection of user account ids.
      Parameters:
      userIds - user account ids of objects to receive. Instance of Collection type.
      Returns:
      collection of users. Instance of Collection type.
    • getLdapUsers

      public List<User> getLdapUsers()
    • createUser

      public void createUser(User user)
      Inserts user into database.
      Parameters:
      user - user to add. Instance of User type.
    • updateUser

      public void updateUser(User user)
      Updates user in database. User's username is ignored.
      Parameters:
      user - user to update. Instance of User type.
    • updateUserAccountLocked

      public void updateUserAccountLocked(Collection<String> userAccountIds, Timestamp updated, boolean locked)
      Updates user's timestamp, locked status by collection of user account ids.
      Parameters:
      userAccountIds - user account ids of objects to update. Instance of Collection type.
      updated - updated timestamp of the object. Instance of Timestamp type.
      locked - locked status of the object. Instance of boolean type.
    • updateUserAccountUpdated

      public void updateUserAccountUpdated(String userId, Timestamp updated)
      Updates user's timestamp by user account id.
      Parameters:
      userId - user account id of the user to update. Instance of String type.
      updated - updated timestamp of the user. Instance of Timestamp type.
    • updateLockedAndEmailConfirmed

      public void updateLockedAndEmailConfirmed(String userId, Timestamp updated, boolean locked, boolean emailConfirmed)
      Updates user's timestamp, emailConfirmed status by user account id.
      Parameters:
      userId - user account id of the user to update. Instance of String type.
      updated - updated timestamp of the user. Instance of Timestamp type.
      locked -
      emailConfirmed - emailConfirmed status of the user. Instance of boolean type.
    • getRoleNamesInOrg

      public List<String> getRoleNamesInOrg(String orgUnitCode)
      Gets all role names of org unit by org unit code.
      Parameters:
      orgUnitCode - user's org unit code. Instance of String type.
      Returns:
      list of role names. Instance of List type.
    • getUserAccountsByRoleNameAndOrgUnitCode

      public List<User> getUserAccountsByRoleNameAndOrgUnitCode(String roleName, String orgUnitCode)
      Gets users with role name in org unit.
      Parameters:
      roleName - user's role name. Instance of String type.
      orgUnitCode - user's org unit code. Instance of String type.
      Returns:
      list of users. Instance of List type.
    • getUsersWithAuthorityIn

      public Collection<User> getUsersWithAuthorityIn(Collection<String> authorityIds)
    • getUsersWithRoleIn

      public Collection<User> getUsersWithRoleIn(Collection<String> roleIds)
    • getUsersWithGroupIn

      public Collection<User> getUsersWithGroupIn(Collection<String> groupIds)