public interface UserDao<U extends User> extends GenericDao<U>
User
s & Credentials
Modifier and Type | Field and Description |
---|---|
static String |
ATTRIB_LIKE_NAME |
static String |
ATTRIB_MODULE_NAMES |
Modifier and Type | Method and Description |
---|---|
Long |
count(Query<U> query) |
long |
countRaw(String query) |
void |
delete(String userNameId)
Remove by Id
|
void |
deleteCredentials(String userNameId)
Remove Credentials
|
Credentials |
getCredentials(String userNameId)
Fetch
Credentials for a given userId. |
String |
getPassword(String userNameId)
Fetch password for a given userId.
|
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
getUser(String, Object) , except here one can override the default Entity type being searched for |
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(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) |
void |
save(Credentials cred)
Save Credentials
|
U |
save(U user,
Credentials cred)
Save user & Credentials data in one transaction
|
static final String ATTRIB_LIKE_NAME
static final String ATTRIB_MODULE_NAMES
long countRaw(String query)
String getUserIdFromAttribute(String attribName, String value)
attribName
- as Stringvalue
- as StringPage<U> loadPage(Query<U> query) throws Exception
U getUser(String fieldName, Object value) throws Exception
User
objectfieldName
- as Stringvalue
- as ObjectException
U getUser(String fieldName, Object value, String entityTypeName) throws Exception
getUser(String, Object)
, except here one can override the default Entity type being searched forfieldName
- as Stringvalue
- as ObjectentityTypeName
- as String (name of Entity type)Exception
String getPassword(String userNameId) throws Exception
userNameId
- as String; userName or emailException
Credentials getCredentials(String userNameId) throws Exception
Credentials
for a given userId. If there is no result or multiple results
it will throw an exception as an erroneous condition.userNameId
- as String; userName or emailCredentials
objectException
U save(U user, Credentials cred)
transientObject
- cred
- U load(String userNameId) throws Exception
User
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.userNameId
- Exception
void save(Credentials cred)
cred
- void deleteCredentials(String userNameId)
void delete(String userNameId)
userNameId
- Copyright © 2018. All rights reserved.