public interface UserDao
User
Modifier and Type | Field and Description |
---|---|
static int |
TRANSFORM_KENMEIUSERVO
This constant is used as a transformation flag; entities can be converted automatically into
value objects or other types, different methods in a class implementing this interface
support this feature: look for an
int parameter called transform . |
static int |
TRANSFORM_NONE
This constant is used as a transformation flag; entities can be converted automatically into
value objects or other types, different methods in a class implementing this interface
support this feature: look for an
int parameter called transform . |
Modifier and Type | Method and Description |
---|---|
Collection<User> |
create(Collection<User> entities)
Creates a new instance of User and adds from the passed in
entities collection |
Collection<?> |
create(int transform,
Collection<User> entities)
Does the same thing as
create(User) with an additional flag called
transform . |
Object |
create(int transform,
User kenmeiUser)
Does the same thing as
create(User) with an additional flag called
transform . |
User |
create(User kenmeiUser)
Creates an instance of User and adds it to the persistent store.
|
void |
createMailNotificationConfig(Long notificationConfigId)
Create the default mail notification config
|
void |
evict(User entity)
Evicts (removes) the entity from the hibernate cache
|
User |
findByAlias(String alias) |
User |
findByEmail(String email)
Find the user by a given email
|
List<User> |
findByExternalSystemId(String systemId)
Returns the users which are members of the foreign system.
|
User |
findByExternalUserId(String userId,
String systemId) |
List<User> |
findByRole(UserRole userRole,
UserStatus status) |
List<User> |
findLatestBySystemId(String externalSystemId,
Long userId,
int maxCount) |
List<User> |
findNotConfirmedUser(Date before,
boolean reminderMailSent) |
Collection<User> |
findNotDeletedUser(boolean excludeSystemUsers)
returns a collection of users which do not have one of the deleted statuses
|
List<User> |
findNotLoggedInActiveUser(Date before,
boolean reminderMailSent,
boolean includeTermsNotAccepted) |
long |
getActiveUserCount() |
long |
getActiveUserCount(String systemId,
UserRole role)
Get the number of users with status ACTIVE.
|
List<Long> |
getFollowedBlogs(Long userId,
long blogIdRangeStart,
long blogIdRangeEnd)
Returns the IDs of the blogs which a user follows
|
List<Long> |
getFollowedDiscussions(Long userId,
long discussionIdRangeStart,
long discussionIdRangeEnd)
Returns the IDs of the discussions followed by a user.
|
List<Long> |
getFollowedTags(Long userId,
Long rangeStart,
Long rangeEnd) |
List<Long> |
getFollowedUsers(Long userId,
long userIdRangeStart,
long userIdRangeEnd)
Returns the IDs of the users a user follows.
|
Object |
load(int transform,
Long id)
Does the same thing as
load(Long) with an additional flag called
transform . |
User |
load(Long id)
Loads an instance of User from the persistent store.
|
Collection<User> |
loadAll()
Loads all entities of type
User . |
Collection<?> |
loadAll(int transform)
Does the same thing as
loadAll() with an additional flag called
transform . |
void |
remove(Collection<User> entities)
Removes all entities in the given
entities |
void |
remove(Long id)
Removes the instance of User having the given
identifier from the persistent
store. |
void |
remove(User user)
Removes the instance of User from the persistent store.
|
void |
resetTermsAccepted(Long userIdToIgnore)
Resets the terms accepted status for all users.
|
UserVO |
toUserVO(User entity)
Converts this DAO's entity to an object of type
UserVO . |
void |
toUserVO(User source,
UserVO target)
Copies the fields of the specified entity to the target value object.
|
void |
toUserVOCollection(Collection entities)
Converts this DAO's entity to a Collection of instances of type
UserVO . |
void |
update(Collection<User> entities)
Updates all instances in the
entities collection in the persistent store. |
void |
update(User user)
Updates the
user instance in the persistent store. |
boolean |
userFollowsItem(Long userId,
Long globalId)
Returns whether the provided user follows the followable item identified by its global ID.
|
User |
userVOToEntity(UserVO userVO)
Creates a new (not persisted) entity and copies the fields of the VO to the corresponding
fields of the entity.
|
void |
userVOToEntity(UserVO source,
User target)
Copies the fields of the VO to the corresponding fields of the entity.
|
static final int TRANSFORM_NONE
int
parameter called transform
.
This specific flag denotes no transformation will occur.static final int TRANSFORM_KENMEIUSERVO
int
parameter called transform
.
This specific flag denotes entities must be transformed into objects of type UserVO
.Collection<User> create(Collection<User> entities)
entities
collectionentities
- the collection of User instances to create.Collection<?> create(int transform, Collection<User> entities)
Does the same thing as create(User)
with an additional flag called
transform
. If this flag is set to TRANSFORM_NONE
then the returned
entity will NOT be transformed. If this flag is any of the other constants
defined here then the result WILL BE passed through an operation which can
optionally transform the entities (into value objects for example). By default,
transformation does not occur.
Object create(int transform, User kenmeiUser)
Does the same thing as create(User)
with an additional flag called
transform
. If this flag is set to TRANSFORM_NONE
then the returned
entity will NOT be transformed. If this flag is any of the other constants
defined here then the result WILL BE passed through an operation which can
optionally transform the entity (into a value object for example). By default, transformation
does not occur.
User create(User kenmeiUser)
void createMailNotificationConfig(Long notificationConfigId)
Create the default mail notification config
void evict(User entity)
entity
- the entity to evictList<User> findByExternalSystemId(String systemId)
Returns the users which are members of the foreign system.
List<User> findByRole(UserRole userRole, UserStatus status)
List<User> findLatestBySystemId(String externalSystemId, Long userId, int maxCount)
List<User> findNotConfirmedUser(Date before, boolean reminderMailSent)
Collection<User> findNotDeletedUser(boolean excludeSystemUsers)
returns a collection of users which do not have one of the deleted statuses
excludeSystemUsers
- whether to exclude the users who have the system user roleList<User> findNotLoggedInActiveUser(Date before, boolean reminderMailSent, boolean includeTermsNotAccepted)
before
- The users status should have changed before this date.reminderMailSent
- A filter for users with or without reminder e-mails already send.includeTermsNotAccepted
- whether to count user in status TERMS_NOT_ACCEPTED as ACTIVElong getActiveUserCount()
long getActiveUserCount(String systemId, UserRole role)
systemId
- ID of an external system to only count the users which originate from this
external system. If null, all users are counted.role
- the role of a user. If not null only the users with that role will be counted
otherwise all roles (including system users) are considered.List<Long> getFollowedBlogs(Long userId, long blogIdRangeStart, long blogIdRangeEnd)
Returns the IDs of the blogs which a user follows
List<Long> getFollowedDiscussions(Long userId, long discussionIdRangeStart, long discussionIdRangeEnd)
Returns the IDs of the discussions followed by a user.
List<Long> getFollowedUsers(Long userId, long userIdRangeStart, long userIdRangeEnd)
Returns the IDs of the users a user follows.
Object load(int transform, Long id)
Does the same thing as load(Long)
with an additional flag called
transform
. If this flag is set to TRANSFORM_NONE
then the returned
entity will NOT be transformed. If this flag is any of the other constants
defined in this class then the result WILL BE passed through an operation
which can optionally transform the entity (into a value object for example). By default,
transformation does not occur.
id
- the identifier of the entity to load.Collection<User> loadAll()
User
.Collection<?> loadAll(int transform)
Does the same thing as loadAll()
with an additional flag called
transform
. If this flag is set to TRANSFORM_NONE
then the returned
entity will NOT be transformed. If this flag is any of the other constants
defined here then the result WILL BE passed through an operation which can
optionally transform the entity (into a value object for example). By default, transformation
does not occur.
transform
- the flag indicating what transformation to use.void remove(Collection<User> entities)
entities collection.
void remove(Long id)
identifier
from the persistent
store.void remove(User user)
void resetTermsAccepted(Long userIdToIgnore)
Resets the terms accepted status for all users.
void toUserVO(User source, UserVO target)
void toUserVOCollection(Collection entities)
UserVO
.void update(Collection<User> entities)
entities
collection in the persistent store.void update(User user)
user
instance in the persistent store.boolean userFollowsItem(Long userId, Long globalId)
Returns whether the provided user follows the followable item identified by its global ID.
User userVOToEntity(UserVO userVO)
Copyright © 2019 Communote team. All rights reserved.