Class UserDao
java.lang.Object
org.apache.openmeetings.db.dao.user.UserDao
- All Implemented Interfaces:
IDataProviderDao<User>,IGroupAdminDataProviderDao<User>
@Repository
@Transactional
public class UserDao
extends Object
implements IGroupAdminDataProviderDao<User>
CRUD operations for
User- Author:
- swagner, vasya
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongadminCount(String search) Count the number of instances ofIGroupAdminDataProviderDaolongadminCount(String search, Long adminId) Count the number of instances ofIGroupAdminDataProviderDaoadminGet(String search, long start, long count, org.apache.wicket.extensions.markup.html.repeater.util.SortParam<String> sort) Get a list of instances ofIGroupAdminDataProviderDaoadminGet(String search, Long adminId, long start, long count, org.apache.wicket.extensions.markup.html.repeater.util.SortParam<String> sort) Get a list of instances ofIGroupAdminDataProviderDaobooleancheckEmail(String email, User.Type type, Long domainId, Long id) Checks if a mail is already taken by someone elsebooleancheckLogin(String login, User.Type type, Long domainId, Long id) check for duplicateslongcount()Count the number of instances ofIDataProviderDaolongCount the number of instances ofIDataProviderDaolonglongcountUsers(String search, Long currentUserId) voidDelete an instance ofIDataProviderDaoget(long first, long count) Get a list of instances ofIDataProviderDaoGet an instance of anIDataProviderDaoget(String search, long start, long count, org.apache.wicket.extensions.markup.html.repeater.util.SortParam<String> sort) Get a list of instances ofIDataProviderDaoget(String search, long start, long count, org.apache.wicket.extensions.markup.html.repeater.util.SortParam<String> sort, boolean filterContacts, Long currentUserId) get(Collection<Long> ids) getByActivationHash(String hash) getByEmail(String email) getByEmail(String _email, User.Type type, Long domainId) getByExpiredHash(long ttl) getByLogin(String _login, User.Type type, Long domainId) getContact(String email, Long ownerId) getContact(String email, String firstName, String lastName, Long ownerId) getContact(String email, User owner) static Set<User.Right>getExternalUser(String extId, String extType) static UsergetNewUserInstance(User currentUser) Get a new instance of theUserentity, with all default values setgetUserByHash(String hash) login logicvoidresetPassword(User u, String password) searchCountUserProfile(Long userId, String search, String userOffers, String userSearches) searchUserProfile(Long userId, String search, String userOffers, String userSearches, org.apache.wicket.extensions.markup.html.repeater.util.SortParam<String> sort, long start, long count) selectMaxFromUsersWithSearch(String search) Update an instance ofIDataProviderDaobooleanvalidLogin(String login) booleanverifyPassword(Long userId, String password) Returns true if the password is correctMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.openmeetings.db.dao.IDataProviderDao
get
-
Field Details
-
FETCH_GROUP_GROUP
- See Also:
-
FETCH_GROUP_BACKUP
- See Also:
-
-
Constructor Details
-
UserDao
public UserDao()
-
-
Method Details
-
getDefaultRights
-
getNewUserInstance
Get a new instance of theUserentity, with all default values set- Parameters:
currentUser- - the user to copy time zone from- Returns:
- new User instance
-
get
Description copied from interface:IDataProviderDaoGet a list of instances ofIDataProviderDao- Specified by:
getin interfaceIDataProviderDao<User>- Parameters:
first- - the start to range to retrievecount- - maximum instance count to retrieve- Returns:
- list of instances in the range specified
-
get
-
get
-
adminGet
public List<User> adminGet(String search, long start, long count, org.apache.wicket.extensions.markup.html.repeater.util.SortParam<String> sort) Description copied from interface:IGroupAdminDataProviderDaoGet a list of instances ofIGroupAdminDataProviderDao- Specified by:
adminGetin interfaceIGroupAdminDataProviderDao<User>- Parameters:
search- - string search criteria to filter entitiesstart- - the start to range to retrievecount- - maximum instance count to retrievesort- - column and sort order- Returns:
- list of instances in the range specified
-
adminGet
public List<User> adminGet(String search, Long adminId, long start, long count, org.apache.wicket.extensions.markup.html.repeater.util.SortParam<String> sort) Description copied from interface:IGroupAdminDataProviderDaoGet a list of instances ofIGroupAdminDataProviderDao- Specified by:
adminGetin interfaceIGroupAdminDataProviderDao<User>- Parameters:
search- - string search criteria to filter entitiesadminId- - id of group admin userstart- - the start to range to retrievecount- - maximum instance count to retrievesort- - column and sort order- Returns:
- list of instances in the range specified
-
searchUserProfile
-
count
public long count()Description copied from interface:IDataProviderDaoCount the number of instances ofIDataProviderDao- Specified by:
countin interfaceIDataProviderDao<User>- Returns:
- count of instances
-
count
Description copied from interface:IDataProviderDaoCount the number of instances ofIDataProviderDao- Specified by:
countin interfaceIDataProviderDao<User>- Parameters:
search- - string search criteria to filter entities- Returns:
- count of instances satisfying given search criteria
-
countUsers
-
count
-
adminCount
Description copied from interface:IGroupAdminDataProviderDaoCount the number of instances ofIGroupAdminDataProviderDao- Specified by:
adminCountin interfaceIGroupAdminDataProviderDao<User>- Parameters:
search- - string search criteria to filter entities- Returns:
- count of instances satisfying given search criteria
-
adminCount
Description copied from interface:IGroupAdminDataProviderDaoCount the number of instances ofIGroupAdminDataProviderDao- Specified by:
adminCountin interfaceIGroupAdminDataProviderDao<User>- Parameters:
search- - string search criteria to filter entitiesadminId- - id of group admin user- Returns:
- count of instances satisfying given search criteria
-
searchCountUserProfile
-
update
Description copied from interface:IDataProviderDaoUpdate an instance ofIDataProviderDao- Specified by:
updatein interfaceIDataProviderDao<User>- Parameters:
u- - entity to be updateduserId- - user performed update- Returns:
- - updated entity
-
resetPassword
- Throws:
NoSuchAlgorithmException
-
update
- Throws:
NoSuchAlgorithmException
-
get
Description copied from interface:IDataProviderDaoGet an instance of anIDataProviderDao- Specified by:
getin interfaceIDataProviderDao<User>- Parameters:
id- - id of instance to retrieve- Returns:
- instance with the id gived
-
delete
Description copied from interface:IDataProviderDaoDelete an instance ofIDataProviderDao- Specified by:
deletein interfaceIDataProviderDao<User>- Parameters:
u- - entity to be deleteduserId- - user performed delete
-
purge
-
get
-
getAllUsers
-
getAllBackupUsers
-
checkLogin
check for duplicates- Parameters:
login- - login to checktype- - userUser.Typeto checkdomainId- - domain to checkid- - id of current user to allow self update- Returns:
truein case login is allowed
-
checkEmail
Checks if a mail is already taken by someone else- Parameters:
email- - email to checktype- - userUser.Typeto checkdomainId- - domain to checkid- - id of current user to allow self update- Returns:
truein case email is allowed
-
validLogin
-
getByLogin
-
getByEmail
-
getByEmail
-
getUserByHash
-
selectMaxFromUsersWithSearch
- Parameters:
search- - term to search- Returns:
- - number of matching user
-
verifyPassword
Returns true if the password is correct- Parameters:
userId- - id of the user to checkpassword- - password to check- Returns:
trueif entered password is correct
-
getContact
-
getContact
-
getContact
-
getContact
-
getContact
-
getByActivationHash
- Parameters:
hash- - activation hash- Returns:
- user with this hash
-
getExternalUser
-
get
public List<User> get(String search, long start, long count, org.apache.wicket.extensions.markup.html.repeater.util.SortParam<String> sort) Description copied from interface:IDataProviderDaoGet a list of instances ofIDataProviderDao- Specified by:
getin interfaceIDataProviderDao<User>- Parameters:
search- - string search criteria to filter entitiesstart- - the start to range to retrievecount- - maximum instance count to retrievesort- - column and sort order- Returns:
- list of instances in the range specified
-
getRights
-
login
login logic- Parameters:
userOrEmail- - login or email of the user being testeduserpass- - password of the user being tested- Returns:
- User object in case of successful login
- Throws:
OmException- in case of any issue
-
getByExpiredHash
-