Liferay 7.0-ce-b4

com.liferay.portal.service.persistence
Class CompanyUtil

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

@ProviderType
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.

Caching information and settings can be found in portal.properties

See Also:
CompanyPersistence, CompanyPersistenceImpl

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()
          Returns the number of companies.
static int countByLogoId(long logoId)
          Returns the number of companies where logoId = ?.
static int countByMx(String mx)
          Returns the number of companies where mx = ?.
static int countBySystem(boolean system)
          Returns the number of companies where system = ?.
static int countByWebId(String webId)
          Returns the number of companies where webId = ?.
static long countWithDynamicQuery(DynamicQuery dynamicQuery)
           
static Company create(long companyId)
          Creates a new company with the primary key.
static Company fetchByLogoId(long logoId)
          Returns the company where logoId = ? or returns null if it could not be found.
static Company fetchByLogoId(long logoId, boolean retrieveFromCache)
          Returns the company where logoId = ? or returns null if it could not be found, optionally using the finder cache.
static Company fetchByMx(String mx)
          Returns the company where mx = ? or returns null if it could not be found.
static Company fetchByMx(String mx, boolean retrieveFromCache)
          Returns the company where mx = ? or returns null if it could not be found, optionally using the finder cache.
static Company fetchByPrimaryKey(long companyId)
          Returns the company with the primary key or returns null if it could not be found.
static Map<Serializable,Company> fetchByPrimaryKeys(Set<Serializable> primaryKeys)
           
static Company fetchBySystem_First(boolean system, OrderByComparator<Company> orderByComparator)
          Returns the first company in the ordered set where system = ?.
static Company fetchBySystem_Last(boolean system, OrderByComparator<Company> orderByComparator)
          Returns the last company in the ordered set where system = ?.
static Company fetchByWebId(String webId)
          Returns the company where webId = ? or returns null if it could not be found.
static Company fetchByWebId(String webId, boolean retrieveFromCache)
          Returns the company where webId = ? or returns null if it could not be found, optionally using the finder cache.
static List<Company> findAll()
          Returns all the companies.
static List<Company> findAll(int start, int end)
          Returns a range of all the companies.
static List<Company> findAll(int start, int end, OrderByComparator<Company> orderByComparator)
          Returns an ordered range of all the companies.
static List<Company> findAll(int start, int end, OrderByComparator<Company> orderByComparator, boolean retrieveFromCache)
          Returns an ordered range of all the companies.
static Company findByLogoId(long logoId)
          Returns the company where logoId = ? or throws a NoSuchCompanyException if it could not be found.
static Company findByMx(String mx)
          Returns the company where mx = ? or throws a NoSuchCompanyException if it could not be found.
static Company findByPrimaryKey(long companyId)
          Returns the company with the primary key or throws a NoSuchCompanyException if it could not be found.
static Company findBySystem_First(boolean system, OrderByComparator<Company> orderByComparator)
          Returns the first company in the ordered set where system = ?.
static Company findBySystem_Last(boolean system, OrderByComparator<Company> orderByComparator)
          Returns the last company in the ordered set where system = ?.
static Company[] findBySystem_PrevAndNext(long companyId, boolean system, OrderByComparator<Company> orderByComparator)
          Returns the companies before and after the current company in the ordered set where system = ?.
static List<Company> findBySystem(boolean system)
          Returns all the companies where system = ?.
static List<Company> findBySystem(boolean system, int start, int end)
          Returns a range of all the companies where system = ?.
static List<Company> findBySystem(boolean system, int start, int end, OrderByComparator<Company> orderByComparator)
          Returns an ordered range of all the companies where system = ?.
static List<Company> findBySystem(boolean system, int start, int end, OrderByComparator<Company> orderByComparator, boolean retrieveFromCache)
          Returns an ordered range of all the companies where system = ?.
static Company findByWebId(String webId)
          Returns 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<Company> orderByComparator)
           
static Set<String> getBadColumnNames()
           
static CompanyPersistence getPersistence()
           
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 Company removeByLogoId(long logoId)
          Removes the company where logoId = ? from the database.
static Company 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 Company removeByWebId(String webId)
          Removes the company where webId = ? from the database.
static Company update(Company company)
           
static Company update(Company company, ServiceContext serviceContext)
           
static Company updateImpl(Company company)
           
 
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 static long countWithDynamicQuery(DynamicQuery dynamicQuery)
See Also:
BasePersistence.countWithDynamicQuery(DynamicQuery)

findWithDynamicQuery

public static List<Company> findWithDynamicQuery(DynamicQuery dynamicQuery)
See Also:
BasePersistence.findWithDynamicQuery(DynamicQuery)

findWithDynamicQuery

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

findWithDynamicQuery

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

update

public static Company update(Company company)
See Also:
BasePersistence.update(com.liferay.portal.model.BaseModel)

update

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

findByWebId

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

Parameters:
webId - the web ID
Returns:
the matching company
Throws:
NoSuchCompanyException - if a matching company could not be found

fetchByWebId

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

Parameters:
webId - the web ID
Returns:
the matching company, or null if a matching company could not be found

fetchByWebId

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

Parameters:
webId - the web ID
retrieveFromCache - whether to retrieve from the finder cache
Returns:
the matching company, or null if a matching company could not be found

removeByWebId

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

Parameters:
webId - the web ID
Returns:
the company that was removed
Throws:
NoSuchCompanyException

countByWebId

public static int countByWebId(String webId)
Returns the number of companies where webId = ?.

Parameters:
webId - the web ID
Returns:
the number of matching companies

findByMx

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

Parameters:
mx - the mx
Returns:
the matching company
Throws:
NoSuchCompanyException - if a matching company could not be found

fetchByMx

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

Parameters:
mx - the mx
Returns:
the matching company, or null if a matching company could not be found

fetchByMx

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

Parameters:
mx - the mx
retrieveFromCache - whether to retrieve from the finder cache
Returns:
the matching company, or null if a matching company could not be found

removeByMx

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

Parameters:
mx - the mx
Returns:
the company that was removed
Throws:
NoSuchCompanyException

countByMx

public static int countByMx(String mx)
Returns the number of companies where mx = ?.

Parameters:
mx - the mx
Returns:
the number of matching companies

findByLogoId

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

Parameters:
logoId - the logo ID
Returns:
the matching company
Throws:
NoSuchCompanyException - if a matching company could not be found

fetchByLogoId

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

Parameters:
logoId - the logo ID
Returns:
the matching company, or null if a matching company could not be found

fetchByLogoId

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

Parameters:
logoId - the logo ID
retrieveFromCache - whether to retrieve from the finder cache
Returns:
the matching company, or null if a matching company could not be found

removeByLogoId

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

Parameters:
logoId - the logo ID
Returns:
the company that was removed
Throws:
NoSuchCompanyException

countByLogoId

public static int countByLogoId(long logoId)
Returns the number of companies where logoId = ?.

Parameters:
logoId - the logo ID
Returns:
the number of matching companies

findBySystem

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

Parameters:
system - the system
Returns:
the matching companies

findBySystem

public static List<Company> findBySystem(boolean system,
                                         int start,
                                         int end)
Returns 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. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not QueryUtil#ALL_POS), then the query will include the default ORDER BY logic from CompanyModelImpl. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.

Parameters:
system - the system
start - the lower bound of the range of companies
end - the upper bound of the range of companies (not inclusive)
Returns:
the range of matching companies

findBySystem

public static List<Company> findBySystem(boolean system,
                                         int start,
                                         int end,
                                         OrderByComparator<Company> orderByComparator)
Returns 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. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not QueryUtil#ALL_POS), then the query will include the default ORDER BY logic from CompanyModelImpl. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.

Parameters:
system - the system
start - the lower bound of the range of companies
end - the upper bound of the range of companies (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
Returns:
the ordered range of matching companies

findBySystem

public static List<Company> findBySystem(boolean system,
                                         int start,
                                         int end,
                                         OrderByComparator<Company> orderByComparator,
                                         boolean retrieveFromCache)
Returns 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. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not QueryUtil#ALL_POS), then the query will include the default ORDER BY logic from CompanyModelImpl. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.

Parameters:
system - the system
start - the lower bound of the range of companies
end - the upper bound of the range of companies (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
retrieveFromCache - whether to retrieve from the finder cache
Returns:
the ordered range of matching companies

findBySystem_First

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

Parameters:
system - the system
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the first matching company
Throws:
NoSuchCompanyException - if a matching company could not be found

fetchBySystem_First

public static Company fetchBySystem_First(boolean system,
                                          OrderByComparator<Company> orderByComparator)
Returns the first company in the ordered set where system = ?.

Parameters:
system - the system
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the first matching company, or null if a matching company could not be found

findBySystem_Last

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

Parameters:
system - the system
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the last matching company
Throws:
NoSuchCompanyException - if a matching company could not be found

fetchBySystem_Last

public static Company fetchBySystem_Last(boolean system,
                                         OrderByComparator<Company> orderByComparator)
Returns the last company in the ordered set where system = ?.

Parameters:
system - the system
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the last matching company, or null if a matching company could not be found

findBySystem_PrevAndNext

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

Parameters:
companyId - the primary key of the current company
system - the system
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the previous, current, and next company
Throws:
NoSuchCompanyException - if a company with the primary key could not be found

removeBySystem

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

Parameters:
system - the system

countBySystem

public static int countBySystem(boolean system)
Returns the number of companies where system = ?.

Parameters:
system - the system
Returns:
the number of matching companies

cacheResult

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

Parameters:
company - the company

cacheResult

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

Parameters:
companies - the companies

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
Removes the company with the primary key from the database. Also notifies the appropriate model listeners.

Parameters:
companyId - the primary key of the company
Returns:
the company that was removed
Throws:
NoSuchCompanyException - if a company with the primary key could not be found

updateImpl

public static Company updateImpl(Company company)

findByPrimaryKey

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

Parameters:
companyId - the primary key of the company
Returns:
the company
Throws:
NoSuchCompanyException - if a company with the primary key could not be found

fetchByPrimaryKey

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

Parameters:
companyId - the primary key of the company
Returns:
the company, or null if a company with the primary key could not be found

fetchByPrimaryKeys

public static Map<Serializable,Company> fetchByPrimaryKeys(Set<Serializable> primaryKeys)

findAll

public static List<Company> findAll()
Returns all the companies.

Returns:
the companies

findAll

public static List<Company> findAll(int start,
                                    int end)
Returns 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. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not QueryUtil#ALL_POS), then the query will include the default ORDER BY logic from CompanyModelImpl. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.

Parameters:
start - the lower bound of the range of companies
end - the upper bound of the range of companies (not inclusive)
Returns:
the range of companies

findAll

public static List<Company> findAll(int start,
                                    int end,
                                    OrderByComparator<Company> orderByComparator)
Returns 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. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not QueryUtil#ALL_POS), then the query will include the default ORDER BY logic from CompanyModelImpl. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.

Parameters:
start - the lower bound of the range of companies
end - the upper bound of the range of companies (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
Returns:
the ordered range of companies

findAll

public static List<Company> findAll(int start,
                                    int end,
                                    OrderByComparator<Company> orderByComparator,
                                    boolean retrieveFromCache)
Returns 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. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not QueryUtil#ALL_POS), then the query will include the default ORDER BY logic from CompanyModelImpl. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.

Parameters:
start - the lower bound of the range of companies
end - the upper bound of the range of companies (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
retrieveFromCache - whether to retrieve from the finder cache
Returns:
the ordered range of companies

removeAll

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


countAll

public static int countAll()
Returns the number of companies.

Returns:
the number of companies

getBadColumnNames

public static Set<String> getBadColumnNames()

getPersistence

public static CompanyPersistence getPersistence()

Liferay 7.0-ce-b4