|
Liferay 7.0-ce-b4 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface BasePersistence<T extends BaseModel<T>>
The base interface for all ServiceBuilder persistence classes. This interface should never need to be used directly.
Caching information and settings can be found in
portal.properties
BasePersistenceImpl| Method Summary | ||
|---|---|---|
void |
clearCache()
Clears the cache for all instances of this model. |
|
void |
clearCache(List<T> modelList)
Clears the cache for a List instances of this model. |
|
void |
clearCache(T model)
Clears the cache for one instance of this model. |
|
void |
closeSession(Session session)
|
|
long |
countWithDynamicQuery(DynamicQuery dynamicQuery)
Returns the number of rows that match the dynamic query. |
|
long |
countWithDynamicQuery(DynamicQuery dynamicQuery,
Projection projection)
Returns the number of rows that match the dynamic query. |
|
T |
fetchByPrimaryKey(Serializable primaryKey)
Returns the model instance with the primary key or returns null if it could not be found. |
|
Map<Serializable,T> |
fetchByPrimaryKeys(Set<Serializable> primaryKeys)
|
|
T |
findByPrimaryKey(Serializable primaryKey)
Returns the model instance with the primary key or throws a NoSuchModelException if it could not be found. |
|
|
findWithDynamicQuery(DynamicQuery dynamicQuery)
Performs a dynamic query on the database and returns the matching rows. |
|
|
findWithDynamicQuery(DynamicQuery dynamicQuery,
int start,
int end)
Performs a dynamic query on the database and returns a range of the matching rows. |
|
|
findWithDynamicQuery(DynamicQuery dynamicQuery,
int start,
int end,
OrderByComparator<V> orderByComparator)
Performs a dynamic query on the database and returns an ordered range of the matching rows. |
|
void |
flush()
|
|
Set<String> |
getBadColumnNames()
|
|
Session |
getCurrentSession()
|
|
DataSource |
getDataSource()
Returns the data source for this model. |
|
ModelListener<T>[] |
getListeners()
Returns the listeners registered for this model. |
|
Class<T> |
getModelClass()
|
|
Session |
openSession()
|
|
SystemException |
processException(Exception e)
|
|
void |
registerListener(ModelListener<T> listener)
Registers a new listener for this model. |
|
T |
remove(Serializable primaryKey)
Removes the model instance with the primary key from the database. |
|
T |
remove(T model)
Removes the model instance from the database. |
|
void |
setDataSource(DataSource dataSource)
Sets the data source for this model. |
|
void |
unregisterListener(ModelListener<T> listener)
Unregisters the model listener. |
|
T |
update(T model)
Updates the model instance in the database or adds it if it does not yet exist. |
|
T |
update(T model,
boolean merge)
Deprecated. As of 6.2.0, replaced by update(BaseModel)} |
|
T |
update(T model,
boolean merge,
ServiceContext serviceContext)
Deprecated. As of 6.2.0, replaced by update(BaseModel,
ServiceContext)} |
|
T |
update(T model,
ServiceContext serviceContext)
Updates the model instance in the database or adds it if it does not yet exist, within a different service context. |
|
| Method Detail |
|---|
void clearCache()
The EntityCache and FinderCache are both cleared by this
method.
void clearCache(List<T> modelList)
The EntityCache and FinderCache are both cleared by this
method.
modelList - the List instances of this model to clear the cache forvoid clearCache(T model)
The EntityCache and FinderCache are both cleared by this
method.
model - the instance of this model to clear the cache forvoid closeSession(Session session)
long countWithDynamicQuery(DynamicQuery dynamicQuery)
dynamicQuery - the dynamic query
long countWithDynamicQuery(DynamicQuery dynamicQuery,
Projection projection)
dynamicQuery - the dynamic queryprojection - the projection to apply to the query
T fetchByPrimaryKey(Serializable primaryKey)
null if it could not be found.
primaryKey - the primary key of the model instance
null if an instance of this
model with the primary key could not be foundMap<Serializable,T> fetchByPrimaryKeys(Set<Serializable> primaryKeys)
T findByPrimaryKey(Serializable primaryKey)
throws NoSuchModelException
NoSuchModelException if it could not be found.
primaryKey - the primary key of the model instance
NoSuchModelException<V> List<V> findWithDynamicQuery(DynamicQuery dynamicQuery)
dynamicQuery - the dynamic query
<V> List<V> findWithDynamicQuery(DynamicQuery dynamicQuery,
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.
dynamicQuery - the dynamic querystart - the lower bound of the range of matching rowsend - the upper bound of the range of matching rows (not inclusive)
QueryUtil.list(
com.liferay.portal.kernel.dao.orm.Query,
com.liferay.portal.kernel.dao.orm.Dialect, int, int)
<V> List<V> findWithDynamicQuery(DynamicQuery dynamicQuery,
int start,
int end,
OrderByComparator<V> 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.
dynamicQuery - the dynamic querystart - the lower bound of the range of matching rowsend - the upper bound of the range of matching rows (not inclusive)orderByComparator - the comparator to order the results by
(optionally null)
void flush()
Set<String> getBadColumnNames()
Session getCurrentSession()
throws ORMException
ORMExceptionDataSource getDataSource()
setDataSource(DataSource)ModelListener<T>[] getListeners()
registerListener(ModelListener)Class<T> getModelClass()
Session openSession()
throws ORMException
ORMExceptionSystemException processException(Exception e)
void registerListener(ModelListener<T> listener)
A model listener is notified whenever a change is made to an instance of this model, such as when one is added, updated, or removed.
listener - the model listener to register
T remove(Serializable primaryKey)
throws NoSuchModelException
primaryKey - the primary key of the model instance to remove
NoSuchModelExceptionT remove(T model)
model - the model instance to remove
void setDataSource(DataSource dataSource)
dataSource - the data source to use for this modelvoid unregisterListener(ModelListener<T> listener)
listener - the model listener to unregisterregisterListener(ModelListener)T update(T model)
Typically not called directly, use local service update model methods
instead. For example, UserLocalServiceUtil.updateUser(
com.liferay.portal.model.User).
model - the model instance to update
@Deprecated
T update(T model,
boolean merge)
update(BaseModel)}
@Deprecated
T update(T model,
boolean merge,
ServiceContext serviceContext)
update(BaseModel,
ServiceContext)}
T update(T model,
ServiceContext serviceContext)
model - the model instance to updateserviceContext - the service context to be applied
|
Liferay 7.0-ce-b4 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||