T - the type of the domain objectPK - the type of the primary key from the domain objectREPOSITORY - the type of the data access object.public abstract class AbstractBusinessService<T extends de.alpharogroup.db.entity.BaseEntity<PK>,PK extends Serializable,REPOSITORY extends de.alpharogroup.db.repository.api.GenericRepository<T,PK>> extends Object implements BusinessService<T,PK>
AbstractBusinessService.| Constructor and Description |
|---|
AbstractBusinessService() |
| Modifier and Type | Method and Description |
|---|---|
void |
delete(List<T> objects)
Delete all persistent objects in the given list.
|
void |
delete(PK id)
Deletes an object of a given Id.
|
void |
delete(T id)
Deletes the given object from persistent storage in the database.
|
void |
evict(T object)
Remove this instance from the session cache.
|
boolean |
exists(PK id)
Checks if an entry exists with the given id.
|
List<T> |
findAll()
Returns a list of objects.
|
T |
get(PK id)
Retrieve a persisted object with a given id from the database.
|
javax.persistence.Query |
getQuery(String s)
Gets the
Query from the given string. |
T |
load(PK id)
Retrieve a persisted object with a given id from the database.
|
List<T> |
merge(List<T> objects)
Merges all new objects in the given list.
|
T |
merge(T object)
Merges the given object.
|
void |
refresh(T object)
Re-read the state of the given instance from the underlying database.
|
List<PK> |
save(List<T> objects)
Save all new objects in the given list.
|
PK |
save(T newInstance)
Persist the given object into database.
|
void |
saveOrUpdate(List<T> objects)
Save or update all given objects into database.
|
void |
saveOrUpdate(T object)
Save or update the given object into database.
|
@Transactional public void delete(List<T> objects)
delete in interface BusinessService<T extends de.alpharogroup.db.entity.BaseEntity<PK>,PK extends Serializable>objects - the list with the persistent objects to delete@Transactional public void delete(PK id)
delete in interface BusinessService<T extends de.alpharogroup.db.entity.BaseEntity<PK>,PK extends Serializable>id - the id@Transactional public void delete(T id)
delete in interface BusinessService<T extends de.alpharogroup.db.entity.BaseEntity<PK>,PK extends Serializable>id - the persistent objectpublic void evict(T object)
evict in interface BusinessService<T extends de.alpharogroup.db.entity.BaseEntity<PK>,PK extends Serializable>object - the object to evict.public boolean exists(PK id)
exists in interface BusinessService<T extends de.alpharogroup.db.entity.BaseEntity<PK>,PK extends Serializable>id - the id to checkpublic List<T> findAll()
findAll in interface BusinessService<T extends de.alpharogroup.db.entity.BaseEntity<PK>,PK extends Serializable>public T get(PK id)
get in interface BusinessService<T extends de.alpharogroup.db.entity.BaseEntity<PK>,PK extends Serializable>id - the idpublic javax.persistence.Query getQuery(String s)
Query from the given string.s - the query as stringpublic T load(PK id)
load in interface BusinessService<T extends de.alpharogroup.db.entity.BaseEntity<PK>,PK extends Serializable>id - the id@Transactional public List<T> merge(List<T> objects)
merge in interface BusinessService<T extends de.alpharogroup.db.entity.BaseEntity<PK>,PK extends Serializable>objects - the list to save@Transactional public T merge(T object)
merge in interface BusinessService<T extends de.alpharogroup.db.entity.BaseEntity<PK>,PK extends Serializable>object - the object@Transactional public void refresh(T object)
refresh in interface BusinessService<T extends de.alpharogroup.db.entity.BaseEntity<PK>,PK extends Serializable>object - the object to refresh.@Transactional public List<PK> save(List<T> objects)
save in interface BusinessService<T extends de.alpharogroup.db.entity.BaseEntity<PK>,PK extends Serializable>objects - the list to save@Transactional public PK save(T newInstance)
save in interface BusinessService<T extends de.alpharogroup.db.entity.BaseEntity<PK>,PK extends Serializable>newInstance - the new instance to save.@Transactional public void saveOrUpdate(List<T> objects)
saveOrUpdate in interface BusinessService<T extends de.alpharogroup.db.entity.BaseEntity<PK>,PK extends Serializable>objects - the objects to save or update.@Transactional public void saveOrUpdate(T object)
saveOrUpdate in interface BusinessService<T extends de.alpharogroup.db.entity.BaseEntity<PK>,PK extends Serializable>object - the object to save or update.Copyright © 2015–2018 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.