@Transactional public class UserDaoImpl<U extends User> extends AbstractQueryableDaoImpl<U> implements UserDao<U>
Users & Credentials
User entities, use different instances of this.
emct, tATTRIB_LIKE_NAME, ATTRIB_MODULE_NAMES| Constructor and Description |
|---|
UserDaoImpl()
Deprecated.
|
UserDaoImpl(Class<U> t) |
UserDaoImpl(Class userClass,
Class credentialsClass) |
| Modifier and Type | Method and Description |
|---|---|
long |
countRaw(String query) |
Long |
delete(Long id)
A special Delete operation on the entity that will remove the entity and related entities based on id.
|
void |
delete(String userNameId)
Remove by Id
|
void |
delete(U persistentObject) |
void |
deleteCredentials(String userNameId)
Remove Credentials
|
protected String |
getCredentialEntityName() |
Credentials |
getCredentials(String userNameId)
Fetch
Credentials for a given userId. |
String |
getPassword(String userNameId)
Fetch password for a given userId.
|
String |
getQueryObjectName()
Deprecated.
|
U |
getUser(String fieldName,
Object value)
Quick lookup on the system to check if any user exists with the value for a given Field Name on the
User object |
U |
getUser(String fieldName,
Object value,
String entityTypeName)
Same as
UserDao.getUser(String, Object), except here one can override the default Entity type being searched for |
protected String |
getUserEntityName() |
Class<U> |
getUserEntityType() |
String |
getUserIdFromAttribute(String attribName,
String value)
Sometimes we have to identify the userId from some attributes like email, phone number etc.
|
U |
load(Object id) |
U |
load(Object id,
Class entityClass)
In some situations the DAO represents an Interface or perhaps a parent of the actual Entity./
The exact type of the entity would have to be Supplied.
|
U |
load(String userNameId)
Due to the abstract nature of
User the actually entity class is not known to load the actual User object. |
Page<U> |
loadPage(Query<U> query)
Load data in paginated fashion.
|
Page<U> |
loadPageRaw(String query,
PageInfo pageInfo) |
List |
query(String ql,
String dialect,
Object... params)
Execute a raw Query in the native implementation language.
|
Page |
query(String ql,
String dialect,
PageInfo pageInfo,
Object... params)
Execute a raw Query in the native implementation language.
|
void |
remove(String fieldName,
Object value,
String entityTypeName) |
void |
save(Credentials cred)
Save Credentials
|
U |
save(U user) |
U |
save(U user,
Credentials cred)
Save user & Credentials data in one transaction
|
conditionConstruct, count, ensureRowIsEntity, ensureRowIsEntity, getEntityInstance, getQueryObject, query, query, queryPage, queryPagegetEntityManager, getNativeEntityName, paginate, setEntityManager, update@Deprecated public UserDaoImpl()
@Deprecated public final String getQueryObjectName()
protected final String getUserEntityName()
protected final String getCredentialEntityName()
public String getUserIdFromAttribute(String attribName, String value)
getUserIdFromAttribute in interface UserDao<U extends User>attribName - as Stringvalue - as String@Transactional(readOnly=true) public String getPassword(String userNameId) throws Exception
UserDaogetPassword in interface UserDao<U extends User>userNameId - as String; userName or emailException@Transactional(readOnly=true) public Credentials getCredentials(String userNameId) throws Exception
UserDaoCredentials for a given userId. If there is no result or multiple results
it will throw an exception as an erroneous condition.getCredentials in interface UserDao<U extends User>userNameId - as String; userName or emailCredentials objectException@Transactional(readOnly=false) public U save(U user, Credentials cred)
UserDao@Transactional(readOnly=false) public U save(U user)
save in interface GenericDao<U extends User>save in class GenericDaoImpl<U extends User>@Transactional(readOnly=false) public void save(Credentials cred)
UserDao@Transactional(readOnly=true) public U load(String userNameId) throws Exception
UserDaoUser the actually entity class is not known to load the actual User object.
For this reason the implementation is responsible for finding the right object based ona n id provided to it.@Transactional(readOnly=false) public void delete(String userNameId)
UserDao@Transactional(readOnly=false) public void remove(String fieldName, Object value, String entityTypeName)
@Transactional(readOnly=false) public void deleteCredentials(String userNameId)
UserDaodeleteCredentials in interface UserDao<U extends User>@Transactional(readOnly=true) public long countRaw(String query)
@Transactional(readOnly=true) public Page<U> loadPage(Query<U> query) throws Exception
UserDao@Transactional(readOnly=true) public Page<U> loadPageRaw(String query, PageInfo pageInfo)
loadPageRaw in interface UserDao<U extends User>pageInfo - @Nullanble truePage@Transactional(readOnly=true) public U getUser(String fieldName, Object value) throws Exception
UserDaoUser object@Transactional(readOnly=true) public U getUser(String fieldName, Object value, String entityTypeName) throws Exception
UserDaoUserDao.getUser(String, Object), except here one can override the default Entity type being searched forpublic Class<U> getUserEntityType()
getUserEntityType in interface UserDao<U extends User>@Transactional(readOnly=false) public void delete(U persistentObject)
delete in interface GenericDao<U extends User>delete in class GenericDaoImpl<U extends User>@Transactional(readOnly=true) public U load(Object id, Class entityClass)
GenericDaoload in interface GenericDao<U extends User>load in class GenericDaoImpl<U extends User>id - as Id for EntityentityClass - as Class of entity@Transactional(readOnly=true) public U load(Object id)
load in interface GenericDao<U extends User>load in class GenericDaoImpl<U extends User>@Transactional(readOnly=false) public Long delete(Long id)
GenericDaodelete in interface GenericDao<U extends User>delete in class GenericDaoImpl<U extends User>Long@Transactional(readOnly=true) public List query(String ql, String dialect, Object... params) throws Exception
GenericDaoImplquery in interface FreeQueryquery in class GenericDaoImpl<U extends User>ql - as String in native Schema languagedialect - as String. NULL or empty or "NATIVE" implies NATIVE, "JPA" implies JPA will be used. Additional dialects can be supported but they will be implementation dependent.params - as Query parameters to the string.
ListException@Transactional(readOnly=true) public Page query(String ql, String dialect, PageInfo pageInfo, Object... params) throws Exception
GenericDaoImplquery in interface FreeQueryquery in class GenericDaoImpl<U extends User>ql - as String in native Schema languagedialect - as String. NULL or empty or "NATIVE" implies NATIVE, "JPA" implies JPA will be used. Additional dialects can be supported but they will be implementation dependent.pageInfo - as PageInfo for pagination of resultparams - as Query parameters to the string
PageExceptionCopyright © 2018. All rights reserved.