Liferay 6.0.5

com.liferay.portal.service.persistence
Class UserGroupUtil

java.lang.Object
  extended by com.liferay.portal.service.persistence.UserGroupUtil

public class UserGroupUtil
extends Object

The persistence utility for the user group service. This utility wraps UserGroupPersistenceImpl and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.

Never modify this class directly. Modify service.xml and rerun ServiceBuilder to regenerate this class.

Caching information and settings can be found in portal.properties

See Also:
UserGroupPersistence, UserGroupPersistenceImpl
ServiceBuilder generated this class. Modifications in this class will be overwritten the next time is generated.

Constructor Summary
UserGroupUtil()
           
 
Method Summary
static void addGroup(long pk, Group group)
          Adds an association between the user group and the group.
static void addGroup(long pk, long groupPK)
          Adds an association between the user group and the group.
static void addGroups(long pk, List<Group> groups)
          Adds an association between the user group and the groups.
static void addGroups(long pk, long[] groupPKs)
          Adds an association between the user group and the groups.
static void addUser(long pk, long userPK)
          Adds an association between the user group and the user.
static void addUser(long pk, User user)
          Adds an association between the user group and the user.
static void addUsers(long pk, List<User> users)
          Adds an association between the user group and the users.
static void addUsers(long pk, long[] userPKs)
          Adds an association between the user group and the users.
static void cacheResult(List<UserGroup> userGroups)
          Caches the user groups in the entity cache if it is enabled.
static void cacheResult(UserGroup userGroup)
          Caches the user group in the entity cache if it is enabled.
static void clearCache()
           
static void clearCache(UserGroup userGroup)
           
static void clearGroups(long pk)
          Clears all associations between the user group and its groups.
static void clearUsers(long pk)
          Clears all associations between the user group and its users.
static boolean containsGroup(long pk, long groupPK)
          Determines whether the group is associated with the user group.
static boolean containsGroups(long pk)
          Determines whether the user group has any groups associated with it.
static boolean containsUser(long pk, long userPK)
          Determines whether the user is associated with the user group.
static boolean containsUsers(long pk)
          Determines whether the user group has any users associated with it.
static int countAll()
          Counts all the user groups.
static int countByC_N(long companyId, String name)
          Counts all the user groups where companyId = ? and name = ?.
static int countByC_P(long companyId, long parentUserGroupId)
          Counts all the user groups where companyId = ? and parentUserGroupId = ?.
static int countByCompanyId(long companyId)
          Counts all the user groups where companyId = ?.
 long countWithDynamicQuery(DynamicQuery dynamicQuery)
           
static UserGroup create(long userGroupId)
          Creates a new user group with the primary key.
static UserGroup fetchByC_N(long companyId, String name)
          Finds the user group where companyId = ? and name = ? or returns null if it could not be found.
static UserGroup fetchByC_N(long companyId, String name, boolean retrieveFromCache)
          Finds the user group where companyId = ? and name = ? or returns null if it could not be found, optionally using the finder cache.
static UserGroup fetchByPrimaryKey(long userGroupId)
          Finds the user group with the primary key or returns null if it could not be found.
static List<UserGroup> findAll()
          Finds all the user groups.
static List<UserGroup> findAll(int start, int end)
          Finds a range of all the user groups.
static List<UserGroup> findAll(int start, int end, OrderByComparator orderByComparator)
          Finds an ordered range of all the user groups.
static UserGroup findByC_N(long companyId, String name)
          Finds the user group where companyId = ? and name = ? or throws a NoSuchUserGroupException if it could not be found.
static UserGroup findByC_P_First(long companyId, long parentUserGroupId, OrderByComparator orderByComparator)
          Finds the first user group in the ordered set where companyId = ? and parentUserGroupId = ?.
static UserGroup findByC_P_Last(long companyId, long parentUserGroupId, OrderByComparator orderByComparator)
          Finds the last user group in the ordered set where companyId = ? and parentUserGroupId = ?.
static UserGroup[] findByC_P_PrevAndNext(long userGroupId, long companyId, long parentUserGroupId, OrderByComparator orderByComparator)
          Finds the user groups before and after the current user group in the ordered set where companyId = ? and parentUserGroupId = ?.
static List<UserGroup> findByC_P(long companyId, long parentUserGroupId)
          Finds all the user groups where companyId = ? and parentUserGroupId = ?.
static List<UserGroup> findByC_P(long companyId, long parentUserGroupId, int start, int end)
          Finds a range of all the user groups where companyId = ? and parentUserGroupId = ?.
static List<UserGroup> findByC_P(long companyId, long parentUserGroupId, int start, int end, OrderByComparator orderByComparator)
          Finds an ordered range of all the user groups where companyId = ? and parentUserGroupId = ?.
static UserGroup findByCompanyId_First(long companyId, OrderByComparator orderByComparator)
          Finds the first user group in the ordered set where companyId = ?.
static UserGroup findByCompanyId_Last(long companyId, OrderByComparator orderByComparator)
          Finds the last user group in the ordered set where companyId = ?.
static UserGroup[] findByCompanyId_PrevAndNext(long userGroupId, long companyId, OrderByComparator orderByComparator)
          Finds the user groups before and after the current user group in the ordered set where companyId = ?.
static List<UserGroup> findByCompanyId(long companyId)
          Finds all the user groups where companyId = ?.
static List<UserGroup> findByCompanyId(long companyId, int start, int end)
          Finds a range of all the user groups where companyId = ?.
static List<UserGroup> findByCompanyId(long companyId, int start, int end, OrderByComparator orderByComparator)
          Finds an ordered range of all the user groups where companyId = ?.
static UserGroup findByPrimaryKey(long userGroupId)
          Finds the user group with the primary key or throws a NoSuchUserGroupException if it could not be found.
static List<UserGroup> findWithDynamicQuery(DynamicQuery dynamicQuery)
           
static List<UserGroup> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end)
           
static List<UserGroup> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator orderByComparator)
           
static List<Group> getGroups(long pk)
          Gets all the groups associated with the user group.
static List<Group> getGroups(long pk, int start, int end)
          Gets a range of all the groups associated with the user group.
static List<Group> getGroups(long pk, int start, int end, OrderByComparator orderByComparator)
          Gets an ordered range of all the groups associated with the user group.
static int getGroupsSize(long pk)
          Gets the number of groups associated with the user group.
static UserGroupPersistence getPersistence()
           
static List<User> getUsers(long pk)
          Gets all the users associated with the user group.
static List<User> getUsers(long pk, int start, int end)
          Gets a range of all the users associated with the user group.
static List<User> getUsers(long pk, int start, int end, OrderByComparator orderByComparator)
          Gets an ordered range of all the users associated with the user group.
static int getUsersSize(long pk)
          Gets the number of users associated with the user group.
static UserGroup remove(long userGroupId)
          Removes the user group with the primary key from the database.
static UserGroup remove(UserGroup userGroup)
           
static void removeAll()
          Removes all the user groups from the database.
static void removeByC_N(long companyId, String name)
          Removes the user group where companyId = ? and name = ? from the database.
static void removeByC_P(long companyId, long parentUserGroupId)
          Removes all the user groups where companyId = ? and parentUserGroupId = ? from the database.
static void removeByCompanyId(long companyId)
          Removes all the user groups where companyId = ? from the database.
static void removeGroup(long pk, Group group)
          Removes the association between the user group and the group.
static void removeGroup(long pk, long groupPK)
          Removes the association between the user group and the group.
static void removeGroups(long pk, List<Group> groups)
          Removes the association between the user group and the groups.
static void removeGroups(long pk, long[] groupPKs)
          Removes the association between the user group and the groups.
static void removeUser(long pk, long userPK)
          Removes the association between the user group and the user.
static void removeUser(long pk, User user)
          Removes the association between the user group and the user.
static void removeUsers(long pk, List<User> users)
          Removes the association between the user group and the users.
static void removeUsers(long pk, long[] userPKs)
          Removes the association between the user group and the users.
static void setGroups(long pk, List<Group> groups)
          Sets the groups associated with the user group, removing and adding associations as necessary.
static void setGroups(long pk, long[] groupPKs)
          Sets the groups associated with the user group, removing and adding associations as necessary.
 void setPersistence(UserGroupPersistence persistence)
           
static void setUsers(long pk, List<User> users)
          Sets the users associated with the user group, removing and adding associations as necessary.
static void setUsers(long pk, long[] userPKs)
          Sets the users associated with the user group, removing and adding associations as necessary.
static UserGroup update(UserGroup userGroup, boolean merge)
           
static UserGroup update(UserGroup userGroup, boolean merge, ServiceContext serviceContext)
           
static UserGroup updateImpl(UserGroup userGroup, boolean merge)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserGroupUtil

public UserGroupUtil()
Method Detail

clearCache

public static void clearCache()
See Also:
BasePersistence.clearCache()

clearCache

public static void clearCache(UserGroup userGroup)
See Also:
BasePersistence.clearCache(com.liferay.portal.model.BaseModel)

countWithDynamicQuery

public long countWithDynamicQuery(DynamicQuery dynamicQuery)
                           throws SystemException
Throws:
SystemException
See Also:
BasePersistence.countWithDynamicQuery(DynamicQuery)

findWithDynamicQuery

public static List<UserGroup> findWithDynamicQuery(DynamicQuery dynamicQuery)
                                            throws SystemException
Throws:
SystemException
See Also:
BasePersistence.findWithDynamicQuery(DynamicQuery)

findWithDynamicQuery

public static List<UserGroup> findWithDynamicQuery(DynamicQuery dynamicQuery,
                                                   int start,
                                                   int end)
                                            throws SystemException
Throws:
SystemException
See Also:
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int)

findWithDynamicQuery

public static List<UserGroup> findWithDynamicQuery(DynamicQuery dynamicQuery,
                                                   int start,
                                                   int end,
                                                   OrderByComparator orderByComparator)
                                            throws SystemException
Throws:
SystemException
See Also:
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)

remove

public static UserGroup remove(UserGroup userGroup)
                        throws SystemException
Throws:
SystemException
See Also:
BasePersistence.remove(com.liferay.portal.model.BaseModel)

update

public static UserGroup update(UserGroup userGroup,
                               boolean merge)
                        throws SystemException
Throws:
SystemException
See Also:
BasePersistence.update(com.liferay.portal.model.BaseModel, boolean)

update

public static UserGroup update(UserGroup userGroup,
                               boolean merge,
                               ServiceContext serviceContext)
                        throws SystemException
Throws:
SystemException
See Also:
BasePersistence.update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)

cacheResult

public static void cacheResult(UserGroup userGroup)
Caches the user group in the entity cache if it is enabled.

Parameters:
userGroup - the user group to cache

cacheResult

public static void cacheResult(List<UserGroup> userGroups)
Caches the user groups in the entity cache if it is enabled.

Parameters:
userGroups - the user groups to cache

create

public static UserGroup create(long userGroupId)
Creates a new user group with the primary key. Does not add the user group to the database.

Parameters:
userGroupId - the primary key for the new user group
Returns:
the new user group

remove

public static UserGroup remove(long userGroupId)
                        throws NoSuchUserGroupException,
                               SystemException
Removes the user group with the primary key from the database. Also notifies the appropriate model listeners.

Parameters:
userGroupId - the primary key of the user group to remove
Returns:
the user group that was removed
Throws:
NoSuchUserGroupException - if a user group with the primary key could not be found
SystemException - if a system exception occurred

updateImpl

public static UserGroup updateImpl(UserGroup userGroup,
                                   boolean merge)
                            throws SystemException
Throws:
SystemException

findByPrimaryKey

public static UserGroup findByPrimaryKey(long userGroupId)
                                  throws NoSuchUserGroupException,
                                         SystemException
Finds the user group with the primary key or throws a NoSuchUserGroupException if it could not be found.

Parameters:
userGroupId - the primary key of the user group to find
Returns:
the user group
Throws:
NoSuchUserGroupException - if a user group with the primary key could not be found
SystemException - if a system exception occurred

fetchByPrimaryKey

public static UserGroup fetchByPrimaryKey(long userGroupId)
                                   throws SystemException
Finds the user group with the primary key or returns null if it could not be found.

Parameters:
userGroupId - the primary key of the user group to find
Returns:
the user group, or null if a user group with the primary key could not be found
Throws:
SystemException - if a system exception occurred

findByCompanyId

public static List<UserGroup> findByCompanyId(long companyId)
                                       throws SystemException
Finds all the user groups where companyId = ?.

Parameters:
companyId - the company id to search with
Returns:
the matching user groups
Throws:
SystemException - if a system exception occurred

findByCompanyId

public static List<UserGroup> findByCompanyId(long companyId,
                                              int start,
                                              int end)
                                       throws SystemException
Finds a range of all the user groups where companyId = ?.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
companyId - the company id to search with
start - the lower bound of the range of user groups to return
end - the upper bound of the range of user groups to return (not inclusive)
Returns:
the range of matching user groups
Throws:
SystemException - if a system exception occurred

findByCompanyId

public static List<UserGroup> findByCompanyId(long companyId,
                                              int start,
                                              int end,
                                              OrderByComparator orderByComparator)
                                       throws SystemException
Finds an ordered range of all the user groups where companyId = ?.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
companyId - the company id to search with
start - the lower bound of the range of user groups to return
end - the upper bound of the range of user groups to return (not inclusive)
orderByComparator - the comparator to order the results by
Returns:
the ordered range of matching user groups
Throws:
SystemException - if a system exception occurred

findByCompanyId_First

public static UserGroup findByCompanyId_First(long companyId,
                                              OrderByComparator orderByComparator)
                                       throws NoSuchUserGroupException,
                                              SystemException
Finds the first user group in the ordered set where companyId = ?.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
companyId - the company id to search with
orderByComparator - the comparator to order the set by
Returns:
the first matching user group
Throws:
NoSuchUserGroupException - if a matching user group could not be found
SystemException - if a system exception occurred

findByCompanyId_Last

public static UserGroup findByCompanyId_Last(long companyId,
                                             OrderByComparator orderByComparator)
                                      throws NoSuchUserGroupException,
                                             SystemException
Finds the last user group in the ordered set where companyId = ?.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
companyId - the company id to search with
orderByComparator - the comparator to order the set by
Returns:
the last matching user group
Throws:
NoSuchUserGroupException - if a matching user group could not be found
SystemException - if a system exception occurred

findByCompanyId_PrevAndNext

public static UserGroup[] findByCompanyId_PrevAndNext(long userGroupId,
                                                      long companyId,
                                                      OrderByComparator orderByComparator)
                                               throws NoSuchUserGroupException,
                                                      SystemException
Finds the user groups before and after the current user group in the ordered set where companyId = ?.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
userGroupId - the primary key of the current user group
companyId - the company id to search with
orderByComparator - the comparator to order the set by
Returns:
the previous, current, and next user group
Throws:
NoSuchUserGroupException - if a user group with the primary key could not be found
SystemException - if a system exception occurred

findByC_P

public static List<UserGroup> findByC_P(long companyId,
                                        long parentUserGroupId)
                                 throws SystemException
Finds all the user groups where companyId = ? and parentUserGroupId = ?.

Parameters:
companyId - the company id to search with
parentUserGroupId - the parent user group id to search with
Returns:
the matching user groups
Throws:
SystemException - if a system exception occurred

findByC_P

public static List<UserGroup> findByC_P(long companyId,
                                        long parentUserGroupId,
                                        int start,
                                        int end)
                                 throws SystemException
Finds a range of all the user groups where companyId = ? and parentUserGroupId = ?.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
companyId - the company id to search with
parentUserGroupId - the parent user group id to search with
start - the lower bound of the range of user groups to return
end - the upper bound of the range of user groups to return (not inclusive)
Returns:
the range of matching user groups
Throws:
SystemException - if a system exception occurred

findByC_P

public static List<UserGroup> findByC_P(long companyId,
                                        long parentUserGroupId,
                                        int start,
                                        int end,
                                        OrderByComparator orderByComparator)
                                 throws SystemException
Finds an ordered range of all the user groups where companyId = ? and parentUserGroupId = ?.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
companyId - the company id to search with
parentUserGroupId - the parent user group id to search with
start - the lower bound of the range of user groups to return
end - the upper bound of the range of user groups to return (not inclusive)
orderByComparator - the comparator to order the results by
Returns:
the ordered range of matching user groups
Throws:
SystemException - if a system exception occurred

findByC_P_First

public static UserGroup findByC_P_First(long companyId,
                                        long parentUserGroupId,
                                        OrderByComparator orderByComparator)
                                 throws NoSuchUserGroupException,
                                        SystemException
Finds the first user group in the ordered set where companyId = ? and parentUserGroupId = ?.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
companyId - the company id to search with
parentUserGroupId - the parent user group id to search with
orderByComparator - the comparator to order the set by
Returns:
the first matching user group
Throws:
NoSuchUserGroupException - if a matching user group could not be found
SystemException - if a system exception occurred

findByC_P_Last

public static UserGroup findByC_P_Last(long companyId,
                                       long parentUserGroupId,
                                       OrderByComparator orderByComparator)
                                throws NoSuchUserGroupException,
                                       SystemException
Finds the last user group in the ordered set where companyId = ? and parentUserGroupId = ?.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
companyId - the company id to search with
parentUserGroupId - the parent user group id to search with
orderByComparator - the comparator to order the set by
Returns:
the last matching user group
Throws:
NoSuchUserGroupException - if a matching user group could not be found
SystemException - if a system exception occurred

findByC_P_PrevAndNext

public static UserGroup[] findByC_P_PrevAndNext(long userGroupId,
                                                long companyId,
                                                long parentUserGroupId,
                                                OrderByComparator orderByComparator)
                                         throws NoSuchUserGroupException,
                                                SystemException
Finds the user groups before and after the current user group in the ordered set where companyId = ? and parentUserGroupId = ?.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
userGroupId - the primary key of the current user group
companyId - the company id to search with
parentUserGroupId - the parent user group id to search with
orderByComparator - the comparator to order the set by
Returns:
the previous, current, and next user group
Throws:
NoSuchUserGroupException - if a user group with the primary key could not be found
SystemException - if a system exception occurred

findByC_N

public static UserGroup findByC_N(long companyId,
                                  String name)
                           throws NoSuchUserGroupException,
                                  SystemException
Finds the user group where companyId = ? and name = ? or throws a NoSuchUserGroupException if it could not be found.

Parameters:
companyId - the company id to search with
name - the name to search with
Returns:
the matching user group
Throws:
NoSuchUserGroupException - if a matching user group could not be found
SystemException - if a system exception occurred

fetchByC_N

public static UserGroup fetchByC_N(long companyId,
                                   String name)
                            throws SystemException
Finds the user group where companyId = ? and name = ? or returns null if it could not be found. Uses the finder cache.

Parameters:
companyId - the company id to search with
name - the name to search with
Returns:
the matching user group, or null if a matching user group could not be found
Throws:
SystemException - if a system exception occurred

fetchByC_N

public static UserGroup fetchByC_N(long companyId,
                                   String name,
                                   boolean retrieveFromCache)
                            throws SystemException
Finds the user group where companyId = ? and name = ? or returns null if it could not be found, optionally using the finder cache.

Parameters:
companyId - the company id to search with
name - the name to search with
Returns:
the matching user group, or null if a matching user group could not be found
Throws:
SystemException - if a system exception occurred

findAll

public static List<UserGroup> findAll()
                               throws SystemException
Finds all the user groups.

Returns:
the user groups
Throws:
SystemException - if a system exception occurred

findAll

public static List<UserGroup> findAll(int start,
                                      int end)
                               throws SystemException
Finds a range of all the user groups.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
start - the lower bound of the range of user groups to return
end - the upper bound of the range of user groups to return (not inclusive)
Returns:
the range of user groups
Throws:
SystemException - if a system exception occurred

findAll

public static List<UserGroup> findAll(int start,
                                      int end,
                                      OrderByComparator orderByComparator)
                               throws SystemException
Finds an ordered range of all the user groups.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
start - the lower bound of the range of user groups to return
end - the upper bound of the range of user groups to return (not inclusive)
orderByComparator - the comparator to order the results by
Returns:
the ordered range of user groups
Throws:
SystemException - if a system exception occurred

removeByCompanyId

public static void removeByCompanyId(long companyId)
                              throws SystemException
Removes all the user groups where companyId = ? from the database.

Parameters:
companyId - the company id to search with
Throws:
SystemException - if a system exception occurred

removeByC_P

public static void removeByC_P(long companyId,
                               long parentUserGroupId)
                        throws SystemException
Removes all the user groups where companyId = ? and parentUserGroupId = ? from the database.

Parameters:
companyId - the company id to search with
parentUserGroupId - the parent user group id to search with
Throws:
SystemException - if a system exception occurred

removeByC_N

public static void removeByC_N(long companyId,
                               String name)
                        throws NoSuchUserGroupException,
                               SystemException
Removes the user group where companyId = ? and name = ? from the database.

Parameters:
companyId - the company id to search with
name - the name to search with
Throws:
SystemException - if a system exception occurred
NoSuchUserGroupException

removeAll

public static void removeAll()
                      throws SystemException
Removes all the user groups from the database.

Throws:
SystemException - if a system exception occurred

countByCompanyId

public static int countByCompanyId(long companyId)
                            throws SystemException
Counts all the user groups where companyId = ?.

Parameters:
companyId - the company id to search with
Returns:
the number of matching user groups
Throws:
SystemException - if a system exception occurred

countByC_P

public static int countByC_P(long companyId,
                             long parentUserGroupId)
                      throws SystemException
Counts all the user groups where companyId = ? and parentUserGroupId = ?.

Parameters:
companyId - the company id to search with
parentUserGroupId - the parent user group id to search with
Returns:
the number of matching user groups
Throws:
SystemException - if a system exception occurred

countByC_N

public static int countByC_N(long companyId,
                             String name)
                      throws SystemException
Counts all the user groups where companyId = ? and name = ?.

Parameters:
companyId - the company id to search with
name - the name to search with
Returns:
the number of matching user groups
Throws:
SystemException - if a system exception occurred

countAll

public static int countAll()
                    throws SystemException
Counts all the user groups.

Returns:
the number of user groups
Throws:
SystemException - if a system exception occurred

getGroups

public static List<Group> getGroups(long pk)
                             throws SystemException
Gets all the groups associated with the user group.

Parameters:
pk - the primary key of the user group to get the associated groups for
Returns:
the groups associated with the user group
Throws:
SystemException - if a system exception occurred

getGroups

public static List<Group> getGroups(long pk,
                                    int start,
                                    int end)
                             throws SystemException
Gets a range of all the groups associated with the user group.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
pk - the primary key of the user group to get the associated groups for
start - the lower bound of the range of user groups to return
end - the upper bound of the range of user groups to return (not inclusive)
Returns:
the range of groups associated with the user group
Throws:
SystemException - if a system exception occurred

getGroups

public static List<Group> getGroups(long pk,
                                    int start,
                                    int end,
                                    OrderByComparator orderByComparator)
                             throws SystemException
Gets an ordered range of all the groups associated with the user group.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
pk - the primary key of the user group to get the associated groups for
start - the lower bound of the range of user groups to return
end - the upper bound of the range of user groups to return (not inclusive)
orderByComparator - the comparator to order the results by
Returns:
the ordered range of groups associated with the user group
Throws:
SystemException - if a system exception occurred

getGroupsSize

public static int getGroupsSize(long pk)
                         throws SystemException
Gets the number of groups associated with the user group.

Parameters:
pk - the primary key of the user group to get the number of associated groups for
Returns:
the number of groups associated with the user group
Throws:
SystemException - if a system exception occurred

containsGroup

public static boolean containsGroup(long pk,
                                    long groupPK)
                             throws SystemException
Determines whether the group is associated with the user group.

Parameters:
pk - the primary key of the user group
groupPK - the primary key of the group
Returns:
whether the group is associated with the user group
Throws:
SystemException - if a system exception occurred

containsGroups

public static boolean containsGroups(long pk)
                              throws SystemException
Determines whether the user group has any groups associated with it.

Parameters:
pk - the primary key of the user group to check for associations with groups
Returns:
whether the user group has any groups associated with it
Throws:
SystemException - if a system exception occurred

addGroup

public static void addGroup(long pk,
                            long groupPK)
                     throws SystemException
Adds an association between the user group and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the user group
groupPK - the primary key of the group
Throws:
SystemException - if a system exception occurred

addGroup

public static void addGroup(long pk,
                            Group group)
                     throws SystemException
Adds an association between the user group and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the user group
group - the group
Throws:
SystemException - if a system exception occurred

addGroups

public static void addGroups(long pk,
                             long[] groupPKs)
                      throws SystemException
Adds an association between the user group and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the user group
groupPKs - the primary keys of the groups
Throws:
SystemException - if a system exception occurred

addGroups

public static void addGroups(long pk,
                             List<Group> groups)
                      throws SystemException
Adds an association between the user group and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the user group
groups - the groups
Throws:
SystemException - if a system exception occurred

clearGroups

public static void clearGroups(long pk)
                        throws SystemException
Clears all associations between the user group and its groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the user group to clear the associated groups from
Throws:
SystemException - if a system exception occurred

removeGroup

public static void removeGroup(long pk,
                               long groupPK)
                        throws SystemException
Removes the association between the user group and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the user group
groupPK - the primary key of the group
Throws:
SystemException - if a system exception occurred

removeGroup

public static void removeGroup(long pk,
                               Group group)
                        throws SystemException
Removes the association between the user group and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the user group
group - the group
Throws:
SystemException - if a system exception occurred

removeGroups

public static void removeGroups(long pk,
                                long[] groupPKs)
                         throws SystemException
Removes the association between the user group and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the user group
groupPKs - the primary keys of the groups
Throws:
SystemException - if a system exception occurred

removeGroups

public static void removeGroups(long pk,
                                List<Group> groups)
                         throws SystemException
Removes the association between the user group and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the user group
groups - the groups
Throws:
SystemException - if a system exception occurred

setGroups

public static void setGroups(long pk,
                             long[] groupPKs)
                      throws SystemException
Sets the groups associated with the user group, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the user group to set the associations for
groupPKs - the primary keys of the groups to be associated with the user group
Throws:
SystemException - if a system exception occurred

setGroups

public static void setGroups(long pk,
                             List<Group> groups)
                      throws SystemException
Sets the groups associated with the user group, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the user group to set the associations for
groups - the groups to be associated with the user group
Throws:
SystemException - if a system exception occurred

getUsers

public static List<User> getUsers(long pk)
                           throws SystemException
Gets all the users associated with the user group.

Parameters:
pk - the primary key of the user group to get the associated users for
Returns:
the users associated with the user group
Throws:
SystemException - if a system exception occurred

getUsers

public static List<User> getUsers(long pk,
                                  int start,
                                  int end)
                           throws SystemException
Gets a range of all the users associated with the user group.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
pk - the primary key of the user group to get the associated users for
start - the lower bound of the range of user groups to return
end - the upper bound of the range of user groups to return (not inclusive)
Returns:
the range of users associated with the user group
Throws:
SystemException - if a system exception occurred

getUsers

public static List<User> getUsers(long pk,
                                  int start,
                                  int end,
                                  OrderByComparator orderByComparator)
                           throws SystemException
Gets an ordered range of all the users associated with the user group.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
pk - the primary key of the user group to get the associated users for
start - the lower bound of the range of user groups to return
end - the upper bound of the range of user groups to return (not inclusive)
orderByComparator - the comparator to order the results by
Returns:
the ordered range of users associated with the user group
Throws:
SystemException - if a system exception occurred

getUsersSize

public static int getUsersSize(long pk)
                        throws SystemException
Gets the number of users associated with the user group.

Parameters:
pk - the primary key of the user group to get the number of associated users for
Returns:
the number of users associated with the user group
Throws:
SystemException - if a system exception occurred

containsUser

public static boolean containsUser(long pk,
                                   long userPK)
                            throws SystemException
Determines whether the user is associated with the user group.

Parameters:
pk - the primary key of the user group
userPK - the primary key of the user
Returns:
whether the user is associated with the user group
Throws:
SystemException - if a system exception occurred

containsUsers

public static boolean containsUsers(long pk)
                             throws SystemException
Determines whether the user group has any users associated with it.

Parameters:
pk - the primary key of the user group to check for associations with users
Returns:
whether the user group has any users associated with it
Throws:
SystemException - if a system exception occurred

addUser

public static void addUser(long pk,
                           long userPK)
                    throws SystemException
Adds an association between the user group and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the user group
userPK - the primary key of the user
Throws:
SystemException - if a system exception occurred

addUser

public static void addUser(long pk,
                           User user)
                    throws SystemException
Adds an association between the user group and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the user group
user - the user
Throws:
SystemException - if a system exception occurred

addUsers

public static void addUsers(long pk,
                            long[] userPKs)
                     throws SystemException
Adds an association between the user group and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the user group
userPKs - the primary keys of the users
Throws:
SystemException - if a system exception occurred

addUsers

public static void addUsers(long pk,
                            List<User> users)
                     throws SystemException
Adds an association between the user group and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the user group
users - the users
Throws:
SystemException - if a system exception occurred

clearUsers

public static void clearUsers(long pk)
                       throws SystemException
Clears all associations between the user group and its users. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the user group to clear the associated users from
Throws:
SystemException - if a system exception occurred

removeUser

public static void removeUser(long pk,
                              long userPK)
                       throws SystemException
Removes the association between the user group and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the user group
userPK - the primary key of the user
Throws:
SystemException - if a system exception occurred

removeUser

public static void removeUser(long pk,
                              User user)
                       throws SystemException
Removes the association between the user group and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the user group
user - the user
Throws:
SystemException - if a system exception occurred

removeUsers

public static void removeUsers(long pk,
                               long[] userPKs)
                        throws SystemException
Removes the association between the user group and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the user group
userPKs - the primary keys of the users
Throws:
SystemException - if a system exception occurred

removeUsers

public static void removeUsers(long pk,
                               List<User> users)
                        throws SystemException
Removes the association between the user group and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the user group
users - the users
Throws:
SystemException - if a system exception occurred

setUsers

public static void setUsers(long pk,
                            long[] userPKs)
                     throws SystemException
Sets the users associated with the user group, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the user group to set the associations for
userPKs - the primary keys of the users to be associated with the user group
Throws:
SystemException - if a system exception occurred

setUsers

public static void setUsers(long pk,
                            List<User> users)
                     throws SystemException
Sets the users associated with the user group, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.

Parameters:
pk - the primary key of the user group to set the associations for
users - the users to be associated with the user group
Throws:
SystemException - if a system exception occurred

getPersistence

public static UserGroupPersistence getPersistence()

setPersistence

public void setPersistence(UserGroupPersistence persistence)

Liferay 6.0.5