|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.northwestern.at.wordhoard.swing.calculator.modelutils.UserDataObjectUtils
public class UserDataObjectUtils
User data object utilities.
Class has package scope.
Constructor Summary | |
---|---|
protected |
UserDataObjectUtils()
Don't allow instantiation but do allow overrides. |
Method Summary | |
---|---|
static java.lang.Long |
createUserDataObject(UserDataObject userDataObject)
Create a user data object. |
static boolean |
deleteUserDataObject(java.lang.Class udoClass,
java.lang.String title)
Delete a user data object by title. |
static boolean |
deleteUserDataObject(UserDataObject userDataObject)
Delete a user data object. |
static boolean |
deleteUserDataObjects(UserDataObject[] userDataObjects)
Delete multiple user data objects. |
protected static java.lang.String |
getObjectClassName(java.lang.Class udoClass)
Get Hibernate object name. |
static UserDataObject |
getUserDataObject(java.lang.Class udoClass,
java.lang.String title)
Get a user data object by title. |
static UserDataObject |
getUserDataObject(java.lang.Class udoClass,
java.lang.String title,
java.lang.String owner)
Get a user data object by title. |
static UserDataObject |
getUserDataObject(java.lang.Class udoClass,
java.lang.String title,
java.lang.String owner,
java.lang.String[] qNames,
java.lang.Object[] qValues)
Get a user data object by title. |
static UserDataObject[] |
getUserDataObjects(java.lang.Class udoClass)
Get all available public user data objects as an array. |
static UserDataObject[] |
getUserDataObjects(java.lang.Class udoClass,
java.lang.String owner)
Get all available user data objects for a specified owner as an array. |
static UserDataObject[] |
getUserDataObjects(java.lang.Class udoClass,
java.lang.String[] qNames,
java.lang.Object[] qValues)
Get all available public user data objects as an array. |
static UserDataObject[] |
getUserDataObjects(java.lang.Class udoClass,
java.lang.String owner,
boolean onlyLoggedInUser)
Get all available user data objects for specified owner as an array. |
static UserDataObject[] |
getUserDataObjects(java.lang.Class udoClass,
java.lang.String title,
java.lang.String owner,
boolean loggedInUserOnly,
java.lang.String[] qNames,
java.lang.Object[] qValues)
Get user data objects. |
static int |
getUserDataObjectsCount(java.lang.Class udoClass)
Get count of all available public user data objects. |
static int |
getUserDataObjectsCount(java.lang.Class udoClass,
boolean loggedInUserOnly)
Get count of user data objects for a user. |
static int |
getUserDataObjectsCount(java.lang.Class udoClass,
java.lang.String owner)
Get count of user data objects for specified user. |
static int |
getUserDataObjectsCount(java.lang.Class udoClass,
java.lang.String owner,
boolean onlyLoggedInUser)
Get count of user data objects for a user. |
static UserDataObject[] |
getUserDataObjectsForLoggedInUser(java.lang.Class udoClass)
Get all available user data objects for logged in user. |
static boolean |
isDuplicate(java.lang.Class udoClass,
java.lang.String title,
java.lang.String owner,
java.lang.Long id)
Check for a duplicate user data object. |
static boolean |
updateUserDataObject(UserDataObject userDataObject,
UserDataObjectUpdater userDataObjectUpdater)
Update a user data object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected UserDataObjectUtils()
Method Detail |
---|
protected static java.lang.String getObjectClassName(java.lang.Class udoClass)
udoClass
- The class for the user data object.
public static boolean isDuplicate(java.lang.Class udoClass, java.lang.String title, java.lang.String owner, java.lang.Long id)
udoClass
- The object's class.title
- The object's title.owner
- The object's owner.id
- The object's ID.
public static boolean deleteUserDataObject(UserDataObject userDataObject)
userDataObject
- The user data object to delete.
The currently logged in user must be the owner to delete a user data object.
public static boolean deleteUserDataObject(java.lang.Class udoClass, java.lang.String title)
udoClass
- The user data object class.title
- The title of the user data object to delete.
public static boolean deleteUserDataObjects(UserDataObject[] userDataObjects)
userDataObjects
- The user data objects to delete.
public static UserDataObject[] getUserDataObjects(java.lang.Class udoClass, java.lang.String title, java.lang.String owner, boolean loggedInUserOnly, java.lang.String[] qNames, java.lang.Object[] qValues)
udoClass
- Class of user data object to return.owner
- The owner for the user data object
to fetch.loggedInUserOnly
- Fetch objects only for the
logged-in user.title
- Title of the user data object to fetch.qNames
- Extra query names.qValues
- Extra query values.
If the owner is not the same as the currently logged in user, the user data objects will only be returned if they are public.
public static UserDataObject getUserDataObject(java.lang.Class udoClass, java.lang.String title, java.lang.String owner, java.lang.String[] qNames, java.lang.Object[] qValues)
udoClass
- Class of user data object to return.owner
- The owner for the user data object to fetch.title
- The title of the user data object to fetch.qNames
- Extra query names.qValues
- Extra query values.
If the owner is not the same as the currently logged in user, the user data object will only be returned if it is public.
public static UserDataObject getUserDataObject(java.lang.Class udoClass, java.lang.String title, java.lang.String owner)
udoClass
- Class of user data object to return.owner
- The owner for the user data object to fetch.title
- The title of the user data object to fetch.
If the owner is not the same as the currently logged in user, the user data object will only be returned if it is public.
public static UserDataObject getUserDataObject(java.lang.Class udoClass, java.lang.String title)
udoClass
- Class of user data object to return.title
- The title of the user data object to fetch.
Only public user data objects are returned.
public static UserDataObject[] getUserDataObjects(java.lang.Class udoClass, java.lang.String[] qNames, java.lang.Object[] qValues)
udoClass
- The name of the user data object type.
If the user is logged in, any private user data objects belonging to the logged in user are also returned.
public static UserDataObject[] getUserDataObjects(java.lang.Class udoClass)
udoClass
- The name of the user data object type.
If the user is logged in, any private user data objects belonging to the logged in user are also returned.
public static UserDataObject[] getUserDataObjects(java.lang.Class udoClass, java.lang.String owner, boolean onlyLoggedInUser)
udoClass
- Name of the user data object type.owner
- Owner for the user data objects
to fetch.onlyLoggedInUser
- True to get only private objects.
public static UserDataObject[] getUserDataObjects(java.lang.Class udoClass, java.lang.String owner)
udoClass
- The name of the user data object type.owner
- The owner.
public static UserDataObject[] getUserDataObjectsForLoggedInUser(java.lang.Class udoClass)
udoClass
- The name of the user data object type.
public static int getUserDataObjectsCount(java.lang.Class udoClass, java.lang.String owner, boolean onlyLoggedInUser)
udoClass
- The name of the user data object type.owner
- The owner.onlyLoggedInUser
- True to count only private objects.
public static int getUserDataObjectsCount(java.lang.Class udoClass, java.lang.String owner)
udoClass
- The name of the user data object type.owner
- The owner.
public static int getUserDataObjectsCount(java.lang.Class udoClass, boolean loggedInUserOnly)
udoClass
- The name of the user data object type.loggedInUserOnly
- Fetch objects only for the
logged-in user.
public static int getUserDataObjectsCount(java.lang.Class udoClass)
udoClass
- The name of the user data object type.
If the user is logged in, any private user data objects belonging to the logged in user are also counted.
public static java.lang.Long createUserDataObject(UserDataObject userDataObject) throws BadOwnerException
userDataObject
- The user data object to create.
user data object.
BadOwnerException
- if user is not
logged in. public static boolean updateUserDataObject(UserDataObject userDataObject, UserDataObjectUpdater userDataObjectUpdater) throws BadOwnerException
userDataObject
- The user data object to update.userDataObjectUpdater
- Method which updates fields of
user data object.
BadOwnerException
- if user is not
logged in or is not the owner of the
user data object.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |