Package com.avoka.fc.core.dao
Class UserProfileDao
java.lang.Object
com.avoka.core.dao.BaseDao
com.avoka.fc.core.dao.AbstractDao
com.avoka.fc.core.dao.UserProfileDao
Provides a DAO for the UserProfile entity.
- See Also:
-
Field Summary
Fields inherited from class com.avoka.core.dao.BaseDao
FETCH_LIMIT, STATEMENT_MAX_NO_PARAMETERS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addUserPropertyToProfiles
(PropertyType propertyType) Ensure all user profiles contain a user property for the given property type (normally a newly created property type).deleteProfile
(UserProfile userProfile) Delete the given user profile, and return the next user profile.getProfile
(UserAccount userAccount, String profileName) Return the user profile with a given name for a given user accountReturn the user profile with the specified OIDReturn the user profiles for the given user account, ordered by profile namevoid
makeCurrentProfile
(UserProfile userProfile) Mark a new user profile as the current one for the user.void
unsetCurrentProfile
(UserProfile oldCurrentProfile) Unset the current flag on a given user profile.void
updateActiveUserProfile
(UserAccount userAccount, Map<String, String> newPropertyMap) Update user account's active profile with the given profile values map.Methods inherited from class com.avoka.fc.core.dao.AbstractDao
andFilterClientExcludeNull, andFilterClientIncludeNull, andFilterClientOnly, isClientAccessAllowed, performQueryConfigCached
Methods inherited from class com.avoka.core.dao.BaseDao
addOrdering, addOrderingCaseInsensitive, addOrderingCaseSensitive, andQueryBetween, andQueryInExp, andQueryInExp, andQueryLikeIgnoreCaseExp, andQueryMatchDbExp, andQueryMatchExp, andQueryMatchIsNotNull, andQueryMatchIsNull, andQueryNoMatchExp, andQueryNotTrue, deleteObject, deleteObjects, findObject, getDataContext, getFetchLimit, getLogger, getObjectForPK, newObject, orQueryLikeIgnoreCaseExp, orQueryMatchExp, performNamedQuery, performNamedQuery, performNamedQuery, performNamedQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performQuery, performQuery, performQuery, registerNewObject, setCacheStrategy, setFetchLimit, setLocalCacheStrategy, setLocalCacheStrategy, setSharedCacheStrategy, toMap, toMap
-
Constructor Details
-
UserProfileDao
public UserProfileDao()
-
-
Method Details
-
getProfileForPK
Return the user profile with the specified OID- Parameters:
id
- the OID- Returns:
- the matching user proile, or null if not found
-
getProfilesForUser
Return the user profiles for the given user account, ordered by profile name- Parameters:
user
- the non-null user account- Returns:
- the list of matching user profiles
-
getProfile
Return the user profile with a given name for a given user account- Parameters:
userAccount
- the non-null user the profile must belong toprofileName
- the non-empty profile name to look for- Returns:
- the matching user profile, if one exists
-
makeCurrentProfile
Mark a new user profile as the current one for the user. After this method has completed, only one user profile will be marked as current for the user.- Parameters:
userProfile
- the non-null user profile to be marked as current
-
unsetCurrentProfile
Unset the current flag on a given user profile. This method will promote another profile to be the current one, and will execute a db commit.- Parameters:
oldCurrentProfile
- the current profile for a SmartForm Manager user
-
deleteProfile
Delete the given user profile, and return the next user profile. If the profile is the last profile for the user a new default user profile will be created.- Parameters:
userProfile
- the non-null user profile to delete- Returns:
- the next profile for the same user
-
addUserPropertyToProfiles
Ensure all user profiles contain a user property for the given property type (normally a newly created property type). The caller will need to commit the changes. Iterates through all user profiles and adds a property if the user profile does not currently have a property value with the same name.- Parameters:
propertyType
- the property type (required, must be of scope 'User' and have a name set)
-
updateActiveUserProfile
Update user account's active profile with the given profile values map. If the user does not have an active profile one will be created. This method will also create user scope PropertyTypes if required. When this method has completed, a profile property will exist for each user property type.- Parameters:
userAccount
- the user account (required)newPropertyMap
- the value to populate the active user profile with (required)- Since:
- 3.6.0
-