Class JPAPersistenceProvider
- All Implemented Interfaces:
Serializable,IPersistenceProvider
- Author:
- Javier Paniza
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidbegin()Mark the starting of the unit of work associated to this thread.voidcommit()Commit the work made by this persistent provider.protected ObjectcreateQuery(String query) Creates a query, it can be Hibernate query or JPA query.Provides tabular data.protected Objectfind(Class pojoClass, Serializable key) Return the object associated to the sent key.voidflush()Save in database all persistent data still in memory.static JPAPersistenceProviderprotected ObjectgetUniqueResult(Object query) Returns the unique result of the sent query.protected voidMarks the object as persistent.voidreassociate(Object entity) Reassociates a detached object to its persistent storage.voidrefreshIfManaged(Object object) Refresh the state of the instance from the database, overwriting changes made to the entity, if any.voidRemove the object from persistent storage.voidrollback()Rollback the work made by this persistent provider.protected voidsetParameterToQuery(Object query, String name, Object value) Sets the parameter to the indicated query.Methods inherited from class org.openxava.model.impl.POJOPersistenceProviderBase
create, createAggregate, find, find, find, findByAnyProperty, findByKeyUsingQuery, getContainer, getKey, getModelName, keyToMap, moveCollectionElement, toPropertiesContainer
-
Method Details
-
getInstance
-
find
Description copied from class:POJOPersistenceProviderBaseReturn the object associated to the sent key.- Specified by:
findin classPOJOPersistenceProviderBase
-
persist
Description copied from class:POJOPersistenceProviderBaseMarks the object as persistent.- Specified by:
persistin classPOJOPersistenceProviderBase
-
remove
public void remove(MetaModel metaModel, Map keyValues) throws javax.ejb.RemoveException, XavaException Description copied from interface:IPersistenceProviderRemove the object from persistent storage.- Throws:
javax.ejb.RemoveExceptionXavaException
-
begin
public void begin()Description copied from interface:IPersistenceProviderMark the starting of the unit of work associated to this thread.This method may be empty (for example in case of using CMT).
-
commit
public void commit()Description copied from interface:IPersistenceProviderCommit the work made by this persistent provider.This method may be empty (for example in case of using CMT).
-
rollback
public void rollback()Description copied from interface:IPersistenceProviderRollback the work made by this persistent provider.This method may be empty (for example in case of using CMT).
-
reassociate
Description copied from interface:IPersistenceProviderReassociates a detached object to its persistent storage.This is for use when an object is serialized using RMI/IIOP, and need to reassociato to its persistent storage.
This method may be empty, because in some technologies has no sense. -
flush
public void flush()Description copied from interface:IPersistenceProviderSave in database all persistent data still in memory.This method may be empty, because in some technologies has no sense.
-
createQuery
Description copied from class:POJOPersistenceProviderBaseCreates a query, it can be Hibernate query or JPA query.- Specified by:
createQueryin classPOJOPersistenceProviderBase
-
setParameterToQuery
Description copied from class:POJOPersistenceProviderBaseSets the parameter to the indicated query.The query is of the type returned by
createQuerymethod.- Specified by:
setParameterToQueryin classPOJOPersistenceProviderBase
-
getUniqueResult
Description copied from class:POJOPersistenceProviderBaseReturns the unique result of the sent query.It does not fail if there more than one match, in this case must returns the first one.
- Specified by:
getUniqueResultin classPOJOPersistenceProviderBase- Parameters:
query- Of the type returned bycreateQuerymethod.- Returns:
- Null if not result.
-
refreshIfManaged
Description copied from interface:IPersistenceProviderRefresh the state of the instance from the database, overwriting changes made to the entity, if any.If the object is null or it's not managed simply do nothing, but not fails.
This method may be empty, because in some technologies has no sense. -
createTabProvider
Description copied from interface:IPersistenceProviderProvides tabular data.
-