public abstract class UserDaoBase extends org.springframework.orm.hibernate3.support.HibernateDaoSupport implements UserDao
Base Spring DAO Class: is able to create, update, remove, load, and find objects of type
com.communote.server.persistence.user.KenmeiUser
.
User
TRANSFORM_KENMEIUSERVO, TRANSFORM_NONE
Constructor and Description |
---|
UserDaoBase() |
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<User> |
create(int transform,
Collection<User> entities)
Does the same thing as
UserDao.create(User) with an additional flag called
transform . |
Object |
create(int transform,
User user)
Does the same thing as
UserDao.create(User) with an additional flag called
transform . |
User |
create(User user)
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) |
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.
|
protected GlobalIdDao |
getGlobalIdDao()
Gets the reference to
globalIdDao . |
protected LanguageDao |
getLanguageDao()
Gets the reference to
languageDao . |
protected NotificationConfigDao |
getNotificationConfigDao()
Gets the reference to
notificationConfigDao . |
protected UserAuthorityDao |
getUserAuthorityDao()
Gets the reference to
UserAuthorityDao . |
protected UserProfileDao |
getUserProfileDao()
Gets the reference to
userProfileDao . |
protected abstract void |
handleCreateMailNotificationConfig(Long notificationConfigId)
Performs the core logic for
createMailNotificationConfig(Long) |
protected abstract User |
handleFindByAlias(String alias)
Performs the core logic for
findByAlias(String) |
protected abstract User |
handleFindByEmail(String email)
Performs the core logic for
findByEmail(String) |
protected abstract List<User> |
handleFindByExternalSystemId(String systemId)
Performs the core logic for
findByExternalSystemId(String) |
protected abstract User |
handleFindByExternalUserId(String userId,
String systemId)
Performs the core logic for
findByExternalUserId(String, String) |
protected abstract List<User> |
handleFindByRole(UserRole userRole,
UserStatus status)
Performs the core logic for
findByRole(com.communote.server.model.user.UserRole, com.communote.server.model.user.UserStatus) |
protected abstract List<User> |
handleFindLatestBySystemId(String externalSystemId,
Long userId,
int maxCount)
Performs the core logic for
findLatestBySystemId(String, Long, int) |
protected abstract List<User> |
handleFindNotConfirmedUser(Date before,
boolean reminderMailSent)
Performs the core logic for
findNotConfirmedUser(java.util.Date, boolean) |
protected abstract Collection<User> |
handleFindNotDeletedUser(boolean excludeSystemUsers)
Performs the core logic for
findNotDeletedUser(boolean) |
protected abstract List<User> |
handleFindNotLoggedInActiveUser(Date before,
boolean reminderMailSent,
boolean includeTermsNotAccepted)
Performs the core logic for
findNotLoggedInActiveUser(java.util.Date, boolean, boolean) |
protected abstract List<Long> |
handleGetFollowedBlogs(Long userId,
long blogIdRangeStart,
long blogIdRangeEnd)
Performs the core logic for
getFollowedBlogs(Long, long, long) |
protected abstract List<Long> |
handleGetFollowedDiscussions(Long userId,
long discussionIdRangeStart,
long discussionIdRangeEnd)
Performs the core logic for
getFollowedDiscussions(Long, long, long) |
protected abstract List<Long> |
handleGetFollowedTags(Long userId,
Long rangeStart,
Long rangeEnd)
Performs the core logic for
getFollowedTags(Long, Long, Long) |
protected abstract List<Long> |
handleGetFollowedUsers(Long userId,
long userIdRangeStart,
long userIdRangeEnd)
Performs the core logic for
getFollowedUsers(Long, long, long) |
protected abstract void |
handleResetTermsAccepted(Long userIdToIgnore)
Performs the core logic for
#resetTermsAccepted() |
protected abstract boolean |
handleUserFollowsItem(Long userId,
Long globalId)
Performs the core logic for
userFollowsItem(Long, Long) |
Object |
load(int transform,
Long id)
Does the same thing as
UserDao.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
UserDao.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.
|
void |
setGlobalIdDao(GlobalIdDao globalIdDao)
Sets the reference to
globalIdDao . |
void |
setLanguageDao(LanguageDao languageDao)
Sets the reference to
languageDao . |
void |
setNotificationConfigDao(NotificationConfigDao notificationConfigDao)
Sets the reference to
notificationConfigDao . |
void |
setUserAuthorityDao(UserAuthorityDao userAuthorityDao)
Sets the reference to
UserAuthorityDao . |
void |
setUserProfileDao(UserProfileDao userProfileDao)
Sets the reference to
userProfileDao . |
protected UserVO |
toKenmeiUserVO(Object[] row)
Default implementation for transforming the results of a report query into a value object.
|
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 . |
protected void |
transformEntities(int transform,
Collection<?> entities)
Transforms a collection of entities using the
transformEntity(int,com.communote.server.model.user.User) method. |
protected Object |
transformEntity(int transform,
User entity)
Allows transformation of entities into value objects (or something else for that matter),
when the
transform flag is set to one of the constants defined in
com.communote.server.persistence.user.UserDao , please note that the
UserDao.TRANSFORM_NONE constant denotes no transformation, so the entity itself will be
returned. |
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.
|
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getActiveUserCount, getActiveUserCount, userVOToEntity, userVOToEntity
public User create(User user)
UserDao
create
in interface UserDao
UserDao.create(com.communote.server.model.user.User)
public Object create(int transform, User user)
UserDao
Does the same thing as UserDao.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.
public Collection<User> create(int transform, Collection<User> entities)
UserDao
Does the same thing as UserDao.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.
public Collection<User> create(Collection<User> entities)
UserDao
entities
collectionpublic void createMailNotificationConfig(Long notificationConfigId)
UserDao
Create the default mail notification config
createMailNotificationConfig
in interface UserDao
UserDao.createMailNotificationConfig(Long)
public void evict(User entity)
public User findByAlias(String alias)
findByAlias
in interface UserDao
UserDao.findByAlias(String)
public User findByEmail(String email)
UserDao
Find the user by a given email
findByEmail
in interface UserDao
UserDao.findByEmail(String)
public List<User> findByExternalSystemId(String systemId)
UserDao
Returns the users which are members of the foreign system.
findByExternalSystemId
in interface UserDao
UserDao.findByExternalSystemId(String)
public User findByExternalUserId(String userId, String systemId)
findByExternalUserId
in interface UserDao
UserDao.findByExternalUserId(String, String)
public List<User> findByRole(UserRole userRole, UserStatus status)
findByRole
in interface UserDao
UserDao.findByRole(com.communote.server.model.user.UserRole,
com.communote.server.model.user.UserStatus)
public List<User> findLatestBySystemId(String externalSystemId, Long userId, int maxCount)
findLatestBySystemId
in interface UserDao
UserDao.findLatestBySystemId(String, Long, int)
public List<User> findNotConfirmedUser(Date before, boolean reminderMailSent)
findNotConfirmedUser
in interface UserDao
UserDao.findNotConfirmedUser(java.util.Date,
boolean)
public Collection<User> findNotDeletedUser(boolean excludeSystemUsers)
UserDao
returns a collection of users which do not have one of the deleted statuses
findNotDeletedUser
in interface UserDao
excludeSystemUsers
- whether to exclude the users who have the system user rolecom.communote.server.persistence.user.UserDao#findNotDeletedUser()
public List<User> findNotLoggedInActiveUser(Date before, boolean reminderMailSent, boolean includeTermsNotAccepted)
findNotLoggedInActiveUser
in interface UserDao
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 ACTIVEpublic List<Long> getFollowedBlogs(Long userId, long blogIdRangeStart, long blogIdRangeEnd)
UserDao
Returns the IDs of the blogs which a user follows
getFollowedBlogs
in interface UserDao
UserDao.getFollowedBlogs(Long, long, long)
public List<Long> getFollowedDiscussions(Long userId, long discussionIdRangeStart, long discussionIdRangeEnd)
UserDao
Returns the IDs of the discussions followed by a user.
getFollowedDiscussions
in interface UserDao
UserDao.getFollowedDiscussions(Long, long, long)
public List<Long> getFollowedTags(Long userId, Long rangeStart, Long rangeEnd)
getFollowedTags
in interface UserDao
UserDao.getFollowedTags(Long, Long, Long)
public List<Long> getFollowedUsers(Long userId, long userIdRangeStart, long userIdRangeEnd)
UserDao
Returns the IDs of the users a user follows.
getFollowedUsers
in interface UserDao
UserDao.getFollowedUsers(Long, long, long)
protected GlobalIdDao getGlobalIdDao()
globalIdDao
.protected LanguageDao getLanguageDao()
languageDao
.protected NotificationConfigDao getNotificationConfigDao()
notificationConfigDao
.protected UserAuthorityDao getUserAuthorityDao()
UserAuthorityDao
.protected UserProfileDao getUserProfileDao()
userProfileDao
.protected abstract void handleCreateMailNotificationConfig(Long notificationConfigId)
createMailNotificationConfig(Long)
protected abstract User handleFindByAlias(String alias)
findByAlias(String)
protected abstract User handleFindByEmail(String email)
findByEmail(String)
protected abstract List<User> handleFindByExternalSystemId(String systemId)
findByExternalSystemId(String)
protected abstract User handleFindByExternalUserId(String userId, String systemId)
findByExternalUserId(String, String)
protected abstract List<User> handleFindByRole(UserRole userRole, UserStatus status)
findByRole(com.communote.server.model.user.UserRole, com.communote.server.model.user.UserStatus)
protected abstract List<User> handleFindLatestBySystemId(String externalSystemId, Long userId, int maxCount)
findLatestBySystemId(String, Long, int)
protected abstract List<User> handleFindNotConfirmedUser(Date before, boolean reminderMailSent)
findNotConfirmedUser(java.util.Date, boolean)
protected abstract Collection<User> handleFindNotDeletedUser(boolean excludeSystemUsers)
findNotDeletedUser(boolean)
protected abstract List<User> handleFindNotLoggedInActiveUser(Date before, boolean reminderMailSent, boolean includeTermsNotAccepted)
findNotLoggedInActiveUser(java.util.Date, boolean, boolean)
protected abstract List<Long> handleGetFollowedBlogs(Long userId, long blogIdRangeStart, long blogIdRangeEnd)
getFollowedBlogs(Long, long, long)
protected abstract List<Long> handleGetFollowedDiscussions(Long userId, long discussionIdRangeStart, long discussionIdRangeEnd)
getFollowedDiscussions(Long, long, long)
protected abstract List<Long> handleGetFollowedTags(Long userId, Long rangeStart, Long rangeEnd)
getFollowedTags(Long, Long, Long)
protected abstract List<Long> handleGetFollowedUsers(Long userId, long userIdRangeStart, long userIdRangeEnd)
getFollowedUsers(Long, long, long)
protected abstract void handleResetTermsAccepted(Long userIdToIgnore)
#resetTermsAccepted()
protected abstract boolean handleUserFollowsItem(Long userId, Long globalId)
userFollowsItem(Long, Long)
public Object load(int transform, Long id)
UserDao
Does the same thing as UserDao.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.
load
in interface UserDao
id
- the identifier of the entity to load.UserDao.load(int, Long)
public User load(Long id)
UserDao
load
in interface UserDao
UserDao.load(Long)
public Collection<User> loadAll()
UserDao
User
.loadAll
in interface UserDao
UserDao.loadAll()
public Collection<?> loadAll(int transform)
UserDao
Does the same thing as UserDao.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.
loadAll
in interface UserDao
transform
- the flag indicating what transformation to use.UserDao.loadAll(int)
public void remove(User user)
UserDao
remove
in interface UserDao
UserDao.remove(com.communote.server.model.user.User)
public void remove(Collection<User> entities)
UserDao
entities collection.
public void remove(Long id)
UserDao
identifier
from the persistent
store.remove
in interface UserDao
UserDao.remove(Long)
public void resetTermsAccepted(Long userIdToIgnore)
UserDao
Resets the terms accepted status for all users.
resetTermsAccepted
in interface UserDao
public void setGlobalIdDao(GlobalIdDao globalIdDao)
globalIdDao
.public void setLanguageDao(LanguageDao languageDao)
languageDao
.public void setNotificationConfigDao(NotificationConfigDao notificationConfigDao)
notificationConfigDao
.public void setUserAuthorityDao(UserAuthorityDao userAuthorityDao)
UserAuthorityDao
.public void setUserProfileDao(UserProfileDao userProfileDao)
userProfileDao
.protected UserVO toKenmeiUserVO(Object[] row)
UserDaoImpl
class if you intend to use reporting queries.public UserVO toUserVO(User entity)
UserDao
UserVO
.toUserVO
in interface UserDao
UserDao.toUserVO(com.communote.server.model.user.User)
public void toUserVO(User source, UserVO target)
UserDao
toUserVO
in interface UserDao
UserDao.toUserVO(com.communote.server.model.user.User,
com.communote.server.api.core.user.UserVO)
public final void toUserVOCollection(Collection entities)
UserDao
UserVO
.toUserVOCollection
in interface UserDao
UserDao.toUserVOCollection(java.util.Collection)
protected void transformEntities(int transform, Collection<?> entities)
transformEntity(int,com.communote.server.model.user.User)
method. This method does
not instantiate a new collection.
This method is to be used internally only.transform
- one of the constants declared in
com.communote.server.persistence.user.UserDao
entities
- the collection of entities to transformtransformEntity(int,com.communote.server.model.user.User)
protected Object transformEntity(int transform, User entity)
transform
flag is set to one of the constants defined in
com.communote.server.persistence.user.UserDao
, please note that the
UserDao.TRANSFORM_NONE
constant denotes no transformation, so the entity itself will be
returned.
This method will return instances of these types:
User
- UserDao.TRANSFORM_NONE
UserVO
- TRANSFORM_KENMEIUSERVO
UserDao.TRANSFORM_NONE
is assumed.transform
- one of the constants declared in
UserDao
entity
- an entity that was foundtransformEntities(int,java.util.Collection)
public void update(User user)
UserDao
user
instance in the persistent store.update
in interface UserDao
UserDao.update(com.communote.server.model.user.User)
public void update(Collection<User> entities)
UserDao
entities
collection in the persistent store.public boolean userFollowsItem(Long userId, Long globalId)
UserDao
Returns whether the provided user follows the followable item identified by its global ID.
userFollowsItem
in interface UserDao
UserDao.userFollowsItem(Long, Long)
Copyright © 2019 Communote team. All rights reserved.