T - the type of the entity objectPK - the type of the primary key from the entity objectpublic class DefaultSaveOrUpdateStrategy<T extends de.alpharogroup.db.entity.BaseEntity<PK>,PK extends Serializable> extends Object implements SaveOrUpdateStrategy<T,PK>
DefaultSaveOrUpdateStrategy is a default implementation of the
SaveOrUpdateStrategy.| Constructor and Description |
|---|
DefaultSaveOrUpdateStrategy(AbstractRepository<T,PK> repository)
Instantiates a new
DefaultSaveOrUpdateStrategy. |
| Modifier and Type | Method and Description |
|---|---|
List<PK> |
save(List<T> entities)
Save all new entities in the given list.
|
PK |
save(T entity)
Persist the given entity into database.
|
void |
saveOrUpdate(List<T> entities)
Save or update all transient entities in the given list.
|
void |
saveOrUpdate(T entity)
Save or update the given persistent entity.
|
void |
update(List<T> entities)
Update all transient entities in the given list.
|
void |
update(T entity)
Update changes made to the given entity.
|
public DefaultSaveOrUpdateStrategy(AbstractRepository<T,PK> repository)
DefaultSaveOrUpdateStrategy.repository - the repositorypublic List<PK> save(List<T> entities)
save in interface SaveOrUpdateStrategy<T extends de.alpharogroup.db.entity.BaseEntity<PK>,PK extends Serializable>entities - the list to savepublic PK save(T entity)
save in interface SaveOrUpdateStrategy<T extends de.alpharogroup.db.entity.BaseEntity<PK>,PK extends Serializable>entity - the new instance to save.public void saveOrUpdate(List<T> entities)
saveOrUpdate in interface SaveOrUpdateStrategy<T extends de.alpharogroup.db.entity.BaseEntity<PK>,PK extends Serializable>entities - the transient entitiespublic void saveOrUpdate(T entity)
saveOrUpdate in interface SaveOrUpdateStrategy<T extends de.alpharogroup.db.entity.BaseEntity<PK>,PK extends Serializable>entity - the transient entity to save or update.public void update(List<T> entities)
update in interface SaveOrUpdateStrategy<T extends de.alpharogroup.db.entity.BaseEntity<PK>,PK extends Serializable>entities - the transient entities to update.public void update(T entity)
update in interface SaveOrUpdateStrategy<T extends de.alpharogroup.db.entity.BaseEntity<PK>,PK extends Serializable>entity - the transient entity to update.Copyright © 2015–2018 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.