Liferay 6.0.5

com.liferay.portal.service.persistence
Class CompanyUtil

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

public class CompanyUtil
extends Object

The persistence utility for the company service. This utility wraps CompanyPersistenceImpl 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:
CompanyPersistence, CompanyPersistenceImpl
ServiceBuilder generated this class. Modifications in this class will be overwritten the next time is generated.

Constructor Summary
CompanyUtil()
           
 
Method Summary
static void cacheResult(Company company)
          Caches the company in the entity cache if it is enabled.
static void cacheResult(List<Company> companies)
          Caches the companies in the entity cache if it is enabled.
static void clearCache()
           
static void clearCache(Company company)
           
static int countAll()
          Counts all the companies.
static int countByLogoId(long logoId)
          Counts all the companies where logoId = ?.
static int countByMx(String mx)
          Counts all the companies where mx = ?.
static int countBySystem(boolean system)
          Counts all the companies where system = ?.
static int countByVirtualHost(String virtualHost)
          Counts all the companies where virtualHost = ?.
static int countByWebId(String webId)
          Counts all the companies where webId = ?.
 long countWithDynamicQuery(DynamicQuery dynamicQuery)
           
static Company create(long companyId)
          Creates a new company with the primary key.
static Company fetchByLogoId(long logoId)
          Finds the company where logoId = ? or returns null if it could not be found.
static Company fetchByLogoId(long logoId, boolean retrieveFromCache)
          Finds the company where logoId = ? or returns null if it could not be found, optionally using the finder cache.
static Company fetchByMx(String mx)
          Finds the company where mx = ? or returns null if it could not be found.
static Company fetchByMx(String mx, boolean retrieveFromCache)
          Finds the company where mx = ? or returns null if it could not be found, optionally using the finder cache.
static Company fetchByPrimaryKey(long companyId)
          Finds the company with the primary key or returns null if it could not be found.
static Company fetchByVirtualHost(String virtualHost)
          Finds the company where virtualHost = ? or returns null if it could not be found.
static Company fetchByVirtualHost(String virtualHost, boolean retrieveFromCache)
          Finds the company where virtualHost = ? or returns null if it could not be found, optionally using the finder cache.
static Company fetchByWebId(String webId)
          Finds the company where webId = ? or returns null if it could not be found.
static Company fetchByWebId(String webId, boolean retrieveFromCache)
          Finds the company where webId = ? or returns null if it could not be found, optionally using the finder cache.
static List<Company> findAll()
          Finds all the companies.
static List<Company> findAll(int start, int end)
          Finds a range of all the companies.
static List<Company> findAll(int start, int end, OrderByComparator orderByComparator)
          Finds an ordered range of all the companies.
static Company findByLogoId(long logoId)
          Finds the company where logoId = ? or throws a NoSuchCompanyException if it could not be found.
static Company findByMx(String mx)
          Finds the company where mx = ? or throws a NoSuchCompanyException if it could not be found.
static Company findByPrimaryKey(long companyId)
          Finds the company with the primary key or throws a NoSuchCompanyException if it could not be found.
static Company findBySystem_First(boolean system, OrderByComparator orderByComparator)
          Finds the first company in the ordered set where system = ?.
static Company findBySystem_Last(boolean system, OrderByComparator orderByComparator)
          Finds the last company in the ordered set where system = ?.
static Company[] findBySystem_PrevAndNext(long companyId, boolean system, OrderByComparator orderByComparator)
          Finds the companies before and after the current company in the ordered set where system = ?.
static List<Company> findBySystem(boolean system)
          Finds all the companies where system = ?.
static List<Company> findBySystem(boolean system, int start, int end)
          Finds a range of all the companies where system = ?.
static List<Company> findBySystem(boolean system, int start, int end, OrderByComparator orderByComparator)
          Finds an ordered range of all the companies where system = ?.
static Company findByVirtualHost(String virtualHost)
          Finds the company where virtualHost = ? or throws a NoSuchCompanyException if it could not be found.
static Company findByWebId(String webId)
          Finds the company where webId = ? or throws a NoSuchCompanyException if it could not be found.
static List<Company> findWithDynamicQuery(DynamicQuery dynamicQuery)
           
static List<Company> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end)
           
static List<Company> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator orderByComparator)
           
static CompanyPersistence getPersistence()
           
static Company remove(Company company)
           
static Company remove(long companyId)
          Removes the company with the primary key from the database.
static void removeAll()
          Removes all the companies from the database.
static void removeByLogoId(long logoId)
          Removes the company where logoId = ? from the database.
static void removeByMx(String mx)
          Removes the company where mx = ? from the database.
static void removeBySystem(boolean system)
          Removes all the companies where system = ? from the database.
static void removeByVirtualHost(String virtualHost)
          Removes the company where virtualHost = ? from the database.
static void removeByWebId(String webId)
          Removes the company where webId = ? from the database.
 void setPersistence(CompanyPersistence persistence)
           
static Company update(Company company, boolean merge)
           
static Company update(Company company, boolean merge, ServiceContext serviceContext)
           
static Company updateImpl(Company company, boolean merge)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompanyUtil

public CompanyUtil()
Method Detail

clearCache

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

clearCache

public static void clearCache(Company company)
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<Company> findWithDynamicQuery(DynamicQuery dynamicQuery)
                                          throws SystemException
Throws:
SystemException
See Also:
BasePersistence.findWithDynamicQuery(DynamicQuery)

findWithDynamicQuery

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

findWithDynamicQuery

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

remove

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

update

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

update

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

cacheResult

public static void cacheResult(Company company)
Caches the company in the entity cache if it is enabled.

Parameters:
company - the company to cache

cacheResult

public static void cacheResult(List<Company> companies)
Caches the companies in the entity cache if it is enabled.

Parameters:
companies - the companies to cache

create

public static Company create(long companyId)
Creates a new company with the primary key. Does not add the company to the database.

Parameters:
companyId - the primary key for the new company
Returns:
the new company

remove

public static Company remove(long companyId)
                      throws NoSuchCompanyException,
                             SystemException
Removes the company with the primary key from the database. Also notifies the appropriate model listeners.

Parameters:
companyId - the primary key of the company to remove
Returns:
the company that was removed
Throws:
NoSuchCompanyException - if a company with the primary key could not be found
SystemException - if a system exception occurred

updateImpl

public static Company updateImpl(Company company,
                                 boolean merge)
                          throws SystemException
Throws:
SystemException

findByPrimaryKey

public static Company findByPrimaryKey(long companyId)
                                throws NoSuchCompanyException,
                                       SystemException
Finds the company with the primary key or throws a NoSuchCompanyException if it could not be found.

Parameters:
companyId - the primary key of the company to find
Returns:
the company
Throws:
NoSuchCompanyException - if a company with the primary key could not be found
SystemException - if a system exception occurred

fetchByPrimaryKey

public static Company fetchByPrimaryKey(long companyId)
                                 throws SystemException
Finds the company with the primary key or returns null if it could not be found.

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

findByWebId

public static Company findByWebId(String webId)
                           throws NoSuchCompanyException,
                                  SystemException
Finds the company where webId = ? or throws a NoSuchCompanyException if it could not be found.

Parameters:
webId - the web id to search with
Returns:
the matching company
Throws:
NoSuchCompanyException - if a matching company could not be found
SystemException - if a system exception occurred

fetchByWebId

public static Company fetchByWebId(String webId)
                            throws SystemException
Finds the company where webId = ? or returns null if it could not be found. Uses the finder cache.

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

fetchByWebId

public static Company fetchByWebId(String webId,
                                   boolean retrieveFromCache)
                            throws SystemException
Finds the company where webId = ? or returns null if it could not be found, optionally using the finder cache.

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

findByVirtualHost

public static Company findByVirtualHost(String virtualHost)
                                 throws NoSuchCompanyException,
                                        SystemException
Finds the company where virtualHost = ? or throws a NoSuchCompanyException if it could not be found.

Parameters:
virtualHost - the virtual host to search with
Returns:
the matching company
Throws:
NoSuchCompanyException - if a matching company could not be found
SystemException - if a system exception occurred

fetchByVirtualHost

public static Company fetchByVirtualHost(String virtualHost)
                                  throws SystemException
Finds the company where virtualHost = ? or returns null if it could not be found. Uses the finder cache.

Parameters:
virtualHost - the virtual host to search with
Returns:
the matching company, or null if a matching company could not be found
Throws:
SystemException - if a system exception occurred

fetchByVirtualHost

public static Company fetchByVirtualHost(String virtualHost,
                                         boolean retrieveFromCache)
                                  throws SystemException
Finds the company where virtualHost = ? or returns null if it could not be found, optionally using the finder cache.

Parameters:
virtualHost - the virtual host to search with
Returns:
the matching company, or null if a matching company could not be found
Throws:
SystemException - if a system exception occurred

findByMx

public static Company findByMx(String mx)
                        throws NoSuchCompanyException,
                               SystemException
Finds the company where mx = ? or throws a NoSuchCompanyException if it could not be found.

Parameters:
mx - the mx to search with
Returns:
the matching company
Throws:
NoSuchCompanyException - if a matching company could not be found
SystemException - if a system exception occurred

fetchByMx

public static Company fetchByMx(String mx)
                         throws SystemException
Finds the company where mx = ? or returns null if it could not be found. Uses the finder cache.

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

fetchByMx

public static Company fetchByMx(String mx,
                                boolean retrieveFromCache)
                         throws SystemException
Finds the company where mx = ? or returns null if it could not be found, optionally using the finder cache.

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

findByLogoId

public static Company findByLogoId(long logoId)
                            throws NoSuchCompanyException,
                                   SystemException
Finds the company where logoId = ? or throws a NoSuchCompanyException if it could not be found.

Parameters:
logoId - the logo id to search with
Returns:
the matching company
Throws:
NoSuchCompanyException - if a matching company could not be found
SystemException - if a system exception occurred

fetchByLogoId

public static Company fetchByLogoId(long logoId)
                             throws SystemException
Finds the company where logoId = ? or returns null if it could not be found. Uses the finder cache.

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

fetchByLogoId

public static Company fetchByLogoId(long logoId,
                                    boolean retrieveFromCache)
                             throws SystemException
Finds the company where logoId = ? or returns null if it could not be found, optionally using the finder cache.

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

findBySystem

public static List<Company> findBySystem(boolean system)
                                  throws SystemException
Finds all the companies where system = ?.

Parameters:
system - the system to search with
Returns:
the matching companies
Throws:
SystemException - if a system exception occurred

findBySystem

public static List<Company> findBySystem(boolean system,
                                         int start,
                                         int end)
                                  throws SystemException
Finds a range of all the companies where system = ?.

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:
system - the system to search with
start - the lower bound of the range of companies to return
end - the upper bound of the range of companies to return (not inclusive)
Returns:
the range of matching companies
Throws:
SystemException - if a system exception occurred

findBySystem

public static List<Company> findBySystem(boolean system,
                                         int start,
                                         int end,
                                         OrderByComparator orderByComparator)
                                  throws SystemException
Finds an ordered range of all the companies where system = ?.

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:
system - the system to search with
start - the lower bound of the range of companies to return
end - the upper bound of the range of companies to return (not inclusive)
orderByComparator - the comparator to order the results by
Returns:
the ordered range of matching companies
Throws:
SystemException - if a system exception occurred

findBySystem_First

public static Company findBySystem_First(boolean system,
                                         OrderByComparator orderByComparator)
                                  throws NoSuchCompanyException,
                                         SystemException
Finds the first company in the ordered set where system = ?.

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:
system - the system to search with
orderByComparator - the comparator to order the set by
Returns:
the first matching company
Throws:
NoSuchCompanyException - if a matching company could not be found
SystemException - if a system exception occurred

findBySystem_Last

public static Company findBySystem_Last(boolean system,
                                        OrderByComparator orderByComparator)
                                 throws NoSuchCompanyException,
                                        SystemException
Finds the last company in the ordered set where system = ?.

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:
system - the system to search with
orderByComparator - the comparator to order the set by
Returns:
the last matching company
Throws:
NoSuchCompanyException - if a matching company could not be found
SystemException - if a system exception occurred

findBySystem_PrevAndNext

public static Company[] findBySystem_PrevAndNext(long companyId,
                                                 boolean system,
                                                 OrderByComparator orderByComparator)
                                          throws NoSuchCompanyException,
                                                 SystemException
Finds the companies before and after the current company in the ordered set where system = ?.

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 primary key of the current company
system - the system to search with
orderByComparator - the comparator to order the set by
Returns:
the previous, current, and next company
Throws:
NoSuchCompanyException - if a company with the primary key could not be found
SystemException - if a system exception occurred

findAll

public static List<Company> findAll()
                             throws SystemException
Finds all the companies.

Returns:
the companies
Throws:
SystemException - if a system exception occurred

findAll

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

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 companies to return
end - the upper bound of the range of companies to return (not inclusive)
Returns:
the range of companies
Throws:
SystemException - if a system exception occurred

findAll

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

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 companies to return
end - the upper bound of the range of companies to return (not inclusive)
orderByComparator - the comparator to order the results by
Returns:
the ordered range of companies
Throws:
SystemException - if a system exception occurred

removeByWebId

public static void removeByWebId(String webId)
                          throws NoSuchCompanyException,
                                 SystemException
Removes the company where webId = ? from the database.

Parameters:
webId - the web id to search with
Throws:
SystemException - if a system exception occurred
NoSuchCompanyException

removeByVirtualHost

public static void removeByVirtualHost(String virtualHost)
                                throws NoSuchCompanyException,
                                       SystemException
Removes the company where virtualHost = ? from the database.

Parameters:
virtualHost - the virtual host to search with
Throws:
SystemException - if a system exception occurred
NoSuchCompanyException

removeByMx

public static void removeByMx(String mx)
                       throws NoSuchCompanyException,
                              SystemException
Removes the company where mx = ? from the database.

Parameters:
mx - the mx to search with
Throws:
SystemException - if a system exception occurred
NoSuchCompanyException

removeByLogoId

public static void removeByLogoId(long logoId)
                           throws NoSuchCompanyException,
                                  SystemException
Removes the company where logoId = ? from the database.

Parameters:
logoId - the logo id to search with
Throws:
SystemException - if a system exception occurred
NoSuchCompanyException

removeBySystem

public static void removeBySystem(boolean system)
                           throws SystemException
Removes all the companies where system = ? from the database.

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

removeAll

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

Throws:
SystemException - if a system exception occurred

countByWebId

public static int countByWebId(String webId)
                        throws SystemException
Counts all the companies where webId = ?.

Parameters:
webId - the web id to search with
Returns:
the number of matching companies
Throws:
SystemException - if a system exception occurred

countByVirtualHost

public static int countByVirtualHost(String virtualHost)
                              throws SystemException
Counts all the companies where virtualHost = ?.

Parameters:
virtualHost - the virtual host to search with
Returns:
the number of matching companies
Throws:
SystemException - if a system exception occurred

countByMx

public static int countByMx(String mx)
                     throws SystemException
Counts all the companies where mx = ?.

Parameters:
mx - the mx to search with
Returns:
the number of matching companies
Throws:
SystemException - if a system exception occurred

countByLogoId

public static int countByLogoId(long logoId)
                         throws SystemException
Counts all the companies where logoId = ?.

Parameters:
logoId - the logo id to search with
Returns:
the number of matching companies
Throws:
SystemException - if a system exception occurred

countBySystem

public static int countBySystem(boolean system)
                         throws SystemException
Counts all the companies where system = ?.

Parameters:
system - the system to search with
Returns:
the number of matching companies
Throws:
SystemException - if a system exception occurred

countAll

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

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

getPersistence

public static CompanyPersistence getPersistence()

setPersistence

public void setPersistence(CompanyPersistence persistence)

Liferay 6.0.5