public class ExpandoTableUtil
extends Object
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
ExpandoTablePersistence
Constructor and Description |
---|
ExpandoTableUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
cacheResult(ExpandoTable expandoTable)
Caches the expando table in the entity cache if it is enabled.
|
static void |
cacheResult(List<ExpandoTable> expandoTables)
Caches the expando tables in the entity cache if it is enabled.
|
static void |
clearCache() |
static void |
clearCache(ExpandoTable expandoTable) |
static int |
countAll()
Returns the number of expando tables.
|
static int |
countByC_C_N(long companyId,
long classNameId,
String name)
Returns the number of expando tables where companyId = ? and classNameId = ? and name = ?.
|
static int |
countByC_C(long companyId,
long classNameId)
Returns the number of expando tables where companyId = ? and classNameId = ?.
|
static long |
countWithDynamicQuery(DynamicQuery dynamicQuery) |
static ExpandoTable |
create(long tableId)
Creates a new expando table with the primary key.
|
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 = ?.
|
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 = ?.
|
static ExpandoTable |
fetchByC_C_N(long companyId,
long classNameId,
String name)
Returns the expando table where companyId = ? and classNameId = ? and name = ? or returns
null if it could not be found. |
static ExpandoTable |
fetchByC_C_N(long companyId,
long classNameId,
String name,
boolean useFinderCache)
Returns the expando table where companyId = ? and classNameId = ? and name = ? or returns
null if it could not be found, optionally using the finder cache. |
static ExpandoTable |
fetchByPrimaryKey(long tableId)
Returns the expando table with the primary key or returns
null if 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 ExpandoTable |
findByC_C_First(long companyId,
long classNameId,
OrderByComparator<ExpandoTable> orderByComparator)
Returns the first expando table in the ordered set where companyId = ? and classNameId = ?.
|
static ExpandoTable |
findByC_C_Last(long companyId,
long classNameId,
OrderByComparator<ExpandoTable> orderByComparator)
Returns the last expando table in the ordered set where companyId = ? and classNameId = ?.
|
static ExpandoTable |
findByC_C_N(long companyId,
long classNameId,
String name)
Returns the expando table where companyId = ? and classNameId = ? and name = ? or throws a
NoSuchTableException if 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 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 ExpandoTable |
findByPrimaryKey(long tableId)
Returns the expando table with the primary key or throws a
NoSuchTableException if 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 ExpandoTablePersistence |
getPersistence() |
static ExpandoTable |
remove(long tableId)
Removes the expando table with the primary key from the database.
|
static void |
removeAll()
Removes all the expando tables from the database.
|
static ExpandoTable |
removeByC_C_N(long companyId,
long classNameId,
String name)
Removes the expando table where companyId = ? and classNameId = ? and name = ? from the database.
|
static void |
removeByC_C(long companyId,
long classNameId)
Removes all the expando tables where companyId = ? and classNameId = ? from the database.
|
static ExpandoTable |
update(ExpandoTable expandoTable) |
static ExpandoTable |
update(ExpandoTable expandoTable,
ServiceContext serviceContext) |
static ExpandoTable |
updateImpl(ExpandoTable expandoTable) |
public static void clearCache()
BasePersistence.clearCache()
public static void clearCache(ExpandoTable expandoTable)
public static long countWithDynamicQuery(DynamicQuery dynamicQuery)
public static Map<Serializable,ExpandoTable> fetchByPrimaryKeys(Set<Serializable> primaryKeys)
BasePersistence.fetchByPrimaryKeys(Set)
public static List<ExpandoTable> findWithDynamicQuery(DynamicQuery dynamicQuery)
public static List<ExpandoTable> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end)
public static List<ExpandoTable> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator<ExpandoTable> orderByComparator)
public static ExpandoTable update(ExpandoTable expandoTable)
public static ExpandoTable update(ExpandoTable expandoTable, ServiceContext serviceContext)
public static List<ExpandoTable> findByC_C(long companyId, long classNameId)
companyId
- the company IDclassNameId
- the class name IDpublic static List<ExpandoTable> findByC_C(long companyId, long classNameId, int start, int end)
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, then the query will include the default ORDER BY logic from ExpandoTableModelImpl
.
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)public static List<ExpandoTable> findByC_C(long companyId, long classNameId, int start, int end, OrderByComparator<ExpandoTable> orderByComparator)
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, then the query will include the default ORDER BY logic from ExpandoTableModelImpl
.
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 (optionally null
)public static List<ExpandoTable> findByC_C(long companyId, long classNameId, int start, int end, OrderByComparator<ExpandoTable> orderByComparator, boolean useFinderCache)
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, then the query will include the default ORDER BY logic from ExpandoTableModelImpl
.
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 (optionally null
)useFinderCache
- whether to use the finder cachepublic static ExpandoTable findByC_C_First(long companyId, long classNameId, OrderByComparator<ExpandoTable> orderByComparator) throws NoSuchTableException
companyId
- the company IDclassNameId
- the class name IDorderByComparator
- the comparator to order the set by (optionally null
)NoSuchTableException
- if a matching expando table could not be foundpublic static ExpandoTable fetchByC_C_First(long companyId, long classNameId, OrderByComparator<ExpandoTable> orderByComparator)
companyId
- the company IDclassNameId
- the class name IDorderByComparator
- the comparator to order the set by (optionally null
)null
if a matching expando table could not be foundpublic static ExpandoTable findByC_C_Last(long companyId, long classNameId, OrderByComparator<ExpandoTable> orderByComparator) throws NoSuchTableException
companyId
- the company IDclassNameId
- the class name IDorderByComparator
- the comparator to order the set by (optionally null
)NoSuchTableException
- if a matching expando table could not be foundpublic static ExpandoTable fetchByC_C_Last(long companyId, long classNameId, OrderByComparator<ExpandoTable> orderByComparator)
companyId
- the company IDclassNameId
- the class name IDorderByComparator
- the comparator to order the set by (optionally null
)null
if a matching expando table could not be foundpublic static ExpandoTable[] findByC_C_PrevAndNext(long tableId, long companyId, long classNameId, OrderByComparator<ExpandoTable> orderByComparator) throws NoSuchTableException
tableId
- the primary key of the current expando tablecompanyId
- the company IDclassNameId
- the class name IDorderByComparator
- the comparator to order the set by (optionally null
)NoSuchTableException
- if a expando table with the primary key could not be foundpublic static void removeByC_C(long companyId, long classNameId)
companyId
- the company IDclassNameId
- the class name IDpublic static int countByC_C(long companyId, long classNameId)
companyId
- the company IDclassNameId
- the class name IDpublic static ExpandoTable findByC_C_N(long companyId, long classNameId, String name) throws NoSuchTableException
NoSuchTableException
if it could not be found.companyId
- the company IDclassNameId
- the class name IDname
- the nameNoSuchTableException
- if a matching expando table could not be foundpublic static ExpandoTable fetchByC_C_N(long companyId, long classNameId, String name)
null
if it could not be found. Uses the finder cache.companyId
- the company IDclassNameId
- the class name IDname
- the namenull
if a matching expando table could not be foundpublic static ExpandoTable fetchByC_C_N(long companyId, long classNameId, String name, boolean useFinderCache)
null
if it could not be found, optionally using the finder cache.companyId
- the company IDclassNameId
- the class name IDname
- the nameuseFinderCache
- whether to use the finder cachenull
if a matching expando table could not be foundpublic static ExpandoTable removeByC_C_N(long companyId, long classNameId, String name) throws NoSuchTableException
companyId
- the company IDclassNameId
- the class name IDname
- the nameNoSuchTableException
public static int countByC_C_N(long companyId, long classNameId, String name)
companyId
- the company IDclassNameId
- the class name IDname
- the namepublic static void cacheResult(ExpandoTable expandoTable)
expandoTable
- the expando tablepublic static void cacheResult(List<ExpandoTable> expandoTables)
expandoTables
- the expando tablespublic static ExpandoTable create(long tableId)
tableId
- the primary key for the new expando tablepublic static ExpandoTable remove(long tableId) throws NoSuchTableException
tableId
- the primary key of the expando tableNoSuchTableException
- if a expando table with the primary key could not be foundpublic static ExpandoTable updateImpl(ExpandoTable expandoTable)
public static ExpandoTable findByPrimaryKey(long tableId) throws NoSuchTableException
NoSuchTableException
if it could not be found.tableId
- the primary key of the expando tableNoSuchTableException
- if a expando table with the primary key could not be foundpublic static ExpandoTable fetchByPrimaryKey(long tableId)
null
if it could not be found.tableId
- the primary key of the expando tablenull
if a expando table with the primary key could not be foundpublic static List<ExpandoTable> findAll()
public static List<ExpandoTable> findAll(int start, int end)
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, then the query will include the default ORDER BY logic from ExpandoTableModelImpl
.
start
- the lower bound of the range of expando tablesend
- the upper bound of the range of expando tables (not inclusive)public static List<ExpandoTable> findAll(int start, int end, OrderByComparator<ExpandoTable> orderByComparator)
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, then the query will include the default ORDER BY logic from ExpandoTableModelImpl
.
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 (optionally null
)public static List<ExpandoTable> findAll(int start, int end, OrderByComparator<ExpandoTable> orderByComparator, boolean useFinderCache)
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, then the query will include the default ORDER BY logic from ExpandoTableModelImpl
.
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 (optionally null
)useFinderCache
- whether to use the finder cachepublic static void removeAll()
public static int countAll()
public static ExpandoTablePersistence getPersistence()