Class ExpandoTableUtil
com.liferay.portlet.expando.service.persistence.impl.ExpandoTablePersistenceImpl 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
- Author:
- Brian Wing Shun Chan
- See Also:
- {$generated.description}
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcacheResult(ExpandoTable expandoTable) Caches the expando table in the entity cache if it is enabled.static voidcacheResult(List<ExpandoTable> expandoTables) Caches the expando tables in the entity cache if it is enabled.static voidstatic voidclearCache(ExpandoTable expandoTable) static intcountAll()Returns the number of expando tables.static intcountByC_C(long companyId, long classNameId) Returns the number of expando tables where companyId = ? and classNameId = ?.static intcountByC_C_N(long companyId, long classNameId, String name) Returns the number of expando tables where companyId = ? and classNameId = ? and name = ?.static longcountWithDynamicQuery(DynamicQuery dynamicQuery) static ExpandoTablecreate(long tableId) Creates a new expando table with the primary key.static ExpandoTablefetchByC_C_First(long companyId, long classNameId, OrderByComparator<ExpandoTable> orderByComparator) Returns the first expando table in the ordered set where companyId = ? and classNameId = ?.static ExpandoTablefetchByC_C_Last(long companyId, long classNameId, OrderByComparator<ExpandoTable> orderByComparator) Returns the last expando table in the ordered set where companyId = ? and classNameId = ?.static ExpandoTablefetchByC_C_N(long companyId, long classNameId, String name) Returns the expando table where companyId = ? and classNameId = ? and name = ? or returnsnullif it could not be found.static ExpandoTablefetchByC_C_N(long companyId, long classNameId, String name, boolean useFinderCache) Returns the expando table where companyId = ? and classNameId = ? and name = ? or returnsnullif it could not be found, optionally using the finder cache.static ExpandoTablefetchByPrimaryKey(long tableId) Returns the expando table with the primary key or returnsnullif it could not be found.static Map<Serializable,ExpandoTable> fetchByPrimaryKeys(Set<Serializable> primaryKeys) static List<ExpandoTable>findAll()Returns all the expando tables.static List<ExpandoTable>findAll(int start, int end) Returns a range of all the expando tables.static List<ExpandoTable>findAll(int start, int end, OrderByComparator<ExpandoTable> orderByComparator) Returns an ordered range of all the expando tables.static List<ExpandoTable>findAll(int start, int end, OrderByComparator<ExpandoTable> orderByComparator, boolean useFinderCache) Returns an ordered range of all the expando tables.static List<ExpandoTable>findByC_C(long companyId, long classNameId) Returns all the expando tables where companyId = ? and classNameId = ?.static List<ExpandoTable>findByC_C(long companyId, long classNameId, int start, int end) Returns a range of all the expando tables where companyId = ? and classNameId = ?.static List<ExpandoTable>findByC_C(long companyId, long classNameId, int start, int end, OrderByComparator<ExpandoTable> orderByComparator) Returns an ordered range of all the expando tables where companyId = ? and classNameId = ?.static List<ExpandoTable>findByC_C(long companyId, long classNameId, int start, int end, OrderByComparator<ExpandoTable> orderByComparator, boolean useFinderCache) Returns an ordered range of all the expando tables where companyId = ? and classNameId = ?.static ExpandoTablefindByC_C_First(long companyId, long classNameId, OrderByComparator<ExpandoTable> orderByComparator) Returns the first expando table in the ordered set where companyId = ? and classNameId = ?.static ExpandoTablefindByC_C_Last(long companyId, long classNameId, OrderByComparator<ExpandoTable> orderByComparator) Returns the last expando table in the ordered set where companyId = ? and classNameId = ?.static ExpandoTablefindByC_C_N(long companyId, long classNameId, String name) Returns the expando table where companyId = ? and classNameId = ? and name = ? or throws aNoSuchTableExceptionif it could not be found.static ExpandoTable[]findByC_C_PrevAndNext(long tableId, long companyId, long classNameId, OrderByComparator<ExpandoTable> orderByComparator) Returns the expando tables before and after the current expando table in the ordered set where companyId = ? and classNameId = ?.static ExpandoTablefindByPrimaryKey(long tableId) Returns the expando table with the primary key or throws aNoSuchTableExceptionif it could not be found.static List<ExpandoTable>findWithDynamicQuery(DynamicQuery dynamicQuery) static List<ExpandoTable>findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end) static List<ExpandoTable>findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator<ExpandoTable> orderByComparator) static ExpandoTablePersistencestatic ExpandoTableremove(long tableId) Removes the expando table with the primary key from the database.static voidRemoves all the expando tables from the database.static voidremoveByC_C(long companyId, long classNameId) Removes all the expando tables where companyId = ? and classNameId = ? from the database.static ExpandoTableremoveByC_C_N(long companyId, long classNameId, String name) Removes the expando table where companyId = ? and classNameId = ? and name = ? from the database.static voidsetPersistence(ExpandoTablePersistence persistence) static ExpandoTableupdate(ExpandoTable expandoTable) static ExpandoTableupdate(ExpandoTable expandoTable, ServiceContext serviceContext) static ExpandoTableupdateImpl(ExpandoTable expandoTable)
-
Constructor Details
-
ExpandoTableUtil
public ExpandoTableUtil()
-
-
Method Details
-
clearCache
public static void clearCache()- See Also:
-
clearCache
-
countWithDynamicQuery
-
fetchByPrimaryKeys
- See Also:
-
findWithDynamicQuery
-
findWithDynamicQuery
public static List<ExpandoTable> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end) -
findWithDynamicQuery
public static List<ExpandoTable> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator<ExpandoTable> orderByComparator) -
update
-
update
-
findByC_C
Returns all the expando tables where companyId = ? and classNameId = ?.- Parameters:
companyId- the company IDclassNameId- the class name ID- Returns:
- the matching expando tables
-
findByC_C
Returns a range of all the expando tables where companyId = ? and classNameId = ?.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromExpandoTableModelImpl.- Parameters:
companyId- the company IDclassNameId- the class name IDstart- the lower bound of the range of expando tablesend- the upper bound of the range of expando tables (not inclusive)- Returns:
- the range of matching expando tables
-
findByC_C
public static List<ExpandoTable> findByC_C(long companyId, long classNameId, int start, int end, OrderByComparator<ExpandoTable> orderByComparator) Returns an ordered range of all the expando tables where companyId = ? and classNameId = ?.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromExpandoTableModelImpl.- Parameters:
companyId- the company IDclassNameId- the class name IDstart- the lower bound of the range of expando tablesend- the upper bound of the range of expando tables (not inclusive)orderByComparator- the comparator to order the results by (optionallynull)- Returns:
- the ordered range of matching expando tables
-
findByC_C
public static List<ExpandoTable> findByC_C(long companyId, long classNameId, int start, int end, OrderByComparator<ExpandoTable> orderByComparator, boolean useFinderCache) Returns an ordered range of all the expando tables where companyId = ? and classNameId = ?.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromExpandoTableModelImpl.- Parameters:
companyId- the company IDclassNameId- the class name IDstart- the lower bound of the range of expando tablesend- the upper bound of the range of expando tables (not inclusive)orderByComparator- the comparator to order the results by (optionallynull)useFinderCache- whether to use the finder cache- Returns:
- the ordered range of matching expando tables
-
findByC_C_First
public static ExpandoTable findByC_C_First(long companyId, long classNameId, OrderByComparator<ExpandoTable> orderByComparator) throws NoSuchTableException Returns the first expando table in the ordered set where companyId = ? and classNameId = ?.- Parameters:
companyId- the company IDclassNameId- the class name IDorderByComparator- the comparator to order the set by (optionallynull)- Returns:
- the first matching expando table
- Throws:
NoSuchTableException- if a matching expando table could not be foundNoSuchTableException
-
fetchByC_C_First
public static ExpandoTable fetchByC_C_First(long companyId, long classNameId, OrderByComparator<ExpandoTable> orderByComparator) Returns the first expando table in the ordered set where companyId = ? and classNameId = ?.- Parameters:
companyId- the company IDclassNameId- the class name IDorderByComparator- the comparator to order the set by (optionallynull)- Returns:
- the first matching expando table, or
nullif a matching expando table could not be found
-
findByC_C_Last
public static ExpandoTable findByC_C_Last(long companyId, long classNameId, OrderByComparator<ExpandoTable> orderByComparator) throws NoSuchTableException Returns the last expando table in the ordered set where companyId = ? and classNameId = ?.- Parameters:
companyId- the company IDclassNameId- the class name IDorderByComparator- the comparator to order the set by (optionallynull)- Returns:
- the last matching expando table
- Throws:
NoSuchTableException- if a matching expando table could not be foundNoSuchTableException
-
fetchByC_C_Last
public static ExpandoTable fetchByC_C_Last(long companyId, long classNameId, OrderByComparator<ExpandoTable> orderByComparator) Returns the last expando table in the ordered set where companyId = ? and classNameId = ?.- Parameters:
companyId- the company IDclassNameId- the class name IDorderByComparator- the comparator to order the set by (optionallynull)- Returns:
- the last matching expando table, or
nullif a matching expando table could not be found
-
findByC_C_PrevAndNext
public static ExpandoTable[] findByC_C_PrevAndNext(long tableId, long companyId, long classNameId, OrderByComparator<ExpandoTable> orderByComparator) throws NoSuchTableException Returns the expando tables before and after the current expando table in the ordered set where companyId = ? and classNameId = ?.- Parameters:
tableId- the primary key of the current expando tablecompanyId- the company IDclassNameId- the class name IDorderByComparator- the comparator to order the set by (optionallynull)- Returns:
- the previous, current, and next expando table
- Throws:
NoSuchTableException- if a expando table with the primary key could not be foundNoSuchTableException
-
removeByC_C
public static void removeByC_C(long companyId, long classNameId) Removes all the expando tables where companyId = ? and classNameId = ? from the database.- Parameters:
companyId- the company IDclassNameId- the class name ID
-
countByC_C
public static int countByC_C(long companyId, long classNameId) Returns the number of expando tables where companyId = ? and classNameId = ?.- Parameters:
companyId- the company IDclassNameId- the class name ID- Returns:
- the number of matching expando tables
-
findByC_C_N
public static ExpandoTable findByC_C_N(long companyId, long classNameId, String name) throws NoSuchTableException Returns the expando table where companyId = ? and classNameId = ? and name = ? or throws aNoSuchTableExceptionif it could not be found.- Parameters:
companyId- the company IDclassNameId- the class name IDname- the name- Returns:
- the matching expando table
- Throws:
NoSuchTableException- if a matching expando table could not be foundNoSuchTableException
-
fetchByC_C_N
Returns the expando table where companyId = ? and classNameId = ? and name = ? or returnsnullif it could not be found. Uses the finder cache.- Parameters:
companyId- the company IDclassNameId- the class name IDname- the name- Returns:
- the matching expando table, or
nullif a matching expando table could not be found
-
fetchByC_C_N
public static ExpandoTable fetchByC_C_N(long companyId, long classNameId, String name, boolean useFinderCache) Returns the expando table where companyId = ? and classNameId = ? and name = ? or returnsnullif it could not be found, optionally using the finder cache.- Parameters:
companyId- the company IDclassNameId- the class name IDname- the nameuseFinderCache- whether to use the finder cache- Returns:
- the matching expando table, or
nullif a matching expando table could not be found
-
removeByC_C_N
public static ExpandoTable removeByC_C_N(long companyId, long classNameId, String name) throws NoSuchTableException Removes the expando table where companyId = ? and classNameId = ? and name = ? from the database.- Parameters:
companyId- the company IDclassNameId- the class name IDname- the name- Returns:
- the expando table that was removed
- Throws:
NoSuchTableException
-
countByC_C_N
Returns the number of expando tables where companyId = ? and classNameId = ? and name = ?.- Parameters:
companyId- the company IDclassNameId- the class name IDname- the name- Returns:
- the number of matching expando tables
-
cacheResult
Caches the expando table in the entity cache if it is enabled.- Parameters:
expandoTable- the expando table
-
cacheResult
Caches the expando tables in the entity cache if it is enabled.- Parameters:
expandoTables- the expando tables
-
create
Creates a new expando table with the primary key. Does not add the expando table to the database.- Parameters:
tableId- the primary key for the new expando table- Returns:
- the new expando table
-
remove
Removes the expando table with the primary key from the database. Also notifies the appropriate model listeners.- Parameters:
tableId- the primary key of the expando table- Returns:
- the expando table that was removed
- Throws:
NoSuchTableException- if a expando table with the primary key could not be foundNoSuchTableException
-
updateImpl
-
findByPrimaryKey
Returns the expando table with the primary key or throws aNoSuchTableExceptionif it could not be found.- Parameters:
tableId- the primary key of the expando table- Returns:
- the expando table
- Throws:
NoSuchTableException- if a expando table with the primary key could not be foundNoSuchTableException
-
fetchByPrimaryKey
Returns the expando table with the primary key or returnsnullif it could not be found.- Parameters:
tableId- the primary key of the expando table- Returns:
- the expando table, or
nullif a expando table with the primary key could not be found
-
findAll
Returns all the expando tables.- Returns:
- the expando tables
-
findAll
Returns a range of all the expando tables.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromExpandoTableModelImpl.- Parameters:
start- the lower bound of the range of expando tablesend- the upper bound of the range of expando tables (not inclusive)- Returns:
- the range of expando tables
-
findAll
public static List<ExpandoTable> findAll(int start, int end, OrderByComparator<ExpandoTable> orderByComparator) Returns an ordered range of all the expando tables.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromExpandoTableModelImpl.- Parameters:
start- the lower bound of the range of expando tablesend- the upper bound of the range of expando tables (not inclusive)orderByComparator- the comparator to order the results by (optionallynull)- Returns:
- the ordered range of expando tables
-
findAll
public static List<ExpandoTable> findAll(int start, int end, OrderByComparator<ExpandoTable> orderByComparator, boolean useFinderCache) Returns an ordered range of all the expando tables.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromExpandoTableModelImpl.- Parameters:
start- the lower bound of the range of expando tablesend- the upper bound of the range of expando tables (not inclusive)orderByComparator- the comparator to order the results by (optionallynull)useFinderCache- whether to use the finder cache- Returns:
- the ordered range of expando tables
-
removeAll
public static void removeAll()Removes all the expando tables from the database. -
countAll
public static int countAll()Returns the number of expando tables.- Returns:
- the number of expando tables
-
getPersistence
-
setPersistence
-