Package org.copperengine.core.persistent
Class DefaultEntityPersister<E>
- java.lang.Object
-
- org.copperengine.core.persistent.DefaultEntityPersister<E>
-
- Type Parameters:
E
- The entity class this persister handles
- All Implemented Interfaces:
EntityPersister<E>
public class DefaultEntityPersister<E> extends java.lang.Object implements EntityPersister<E>
Default implementation of theEntityPersister
interface. This implementation plugs in DefaultPersistenceWorkers and is convenient to implement. On limitations seeDefaultWorkflowPersistencePlugin
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultEntityPersister.EntityAndCallback<E extends PersistentEntity>
-
Nested classes/interfaces inherited from interface org.copperengine.core.persistent.EntityPersister
EntityPersister.PostSelectedCallback<E>
-
-
Constructor Summary
Constructors Constructor Description DefaultEntityPersister(PersistentWorkflow<?> workflow, DefaultPersistenceWorker<E,? extends EntityPersister<E>> selectionWorker, DefaultPersistenceWorker<E,? extends EntityPersister<E>> insertionWorker, DefaultPersistenceWorker<E,? extends EntityPersister<E>> updateWorker, DefaultPersistenceWorker<E,? extends EntityPersister<E>> deletionWorker)
DefaultEntityPersister(PersistentWorkflow<?> workflow, DefaultPersisterSimpleCRUDSharedRessources<E,? extends DefaultEntityPersister<E>> sharedRessources)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete(E e)
Issues a delete for the entity.void
insert(E e)
Issues an insert for the entity.void
select(E e, EntityPersister.PostSelectedCallback<E> callback)
Issues a select for the entity that will be executed later.void
update(E e)
Issues an update for the entity.
-
-
-
Constructor Detail
-
DefaultEntityPersister
public DefaultEntityPersister(PersistentWorkflow<?> workflow, DefaultPersistenceWorker<E,? extends EntityPersister<E>> selectionWorker, DefaultPersistenceWorker<E,? extends EntityPersister<E>> insertionWorker, DefaultPersistenceWorker<E,? extends EntityPersister<E>> updateWorker, DefaultPersistenceWorker<E,? extends EntityPersister<E>> deletionWorker)
-
DefaultEntityPersister
public DefaultEntityPersister(PersistentWorkflow<?> workflow, DefaultPersisterSimpleCRUDSharedRessources<E,? extends DefaultEntityPersister<E>> sharedRessources)
-
-
Method Detail
-
select
public void select(E e, EntityPersister.PostSelectedCallback<E> callback)
Description copied from interface:EntityPersister
Issues a select for the entity that will be executed later. The entity has to contain the identifying data used to select it. Later on, the callback is called either viaentitySelected
orentityNotFound
- Specified by:
select
in interfaceEntityPersister<E>
- Parameters:
e
- the entity to select. The identifier has to be set.callback
- the callback to call with the selection results
-
insert
public void insert(E e)
Description copied from interface:EntityPersister
Issues an insert for the entity. The insertion will be effectively committed when the workflow instance is committed too.- Specified by:
insert
in interfaceEntityPersister<E>
- Parameters:
e
- the entity to insert.
-
update
public void update(E e)
Description copied from interface:EntityPersister
Issues an update for the entity. The update will be effectively committed when the workflow instance is committed too.- Specified by:
update
in interfaceEntityPersister<E>
- Parameters:
e
- the entity to insert.
-
delete
public void delete(E e)
Description copied from interface:EntityPersister
Issues a delete for the entity. The deletion will be effectively committed when the workflow instance is committed too.- Specified by:
delete
in interfaceEntityPersister<E>
- Parameters:
e
- the entity to insert.
-
-