PK - the generic type of the primary keyDO - the generic type of the domain objectE - the element type of the entityREPOSITORY - the generic type of the data transfer objectM - the generic type of the entity mapper@Transactional public abstract class AbstractDomainService<PK extends Serializable,DO extends DomainObject<PK>,E extends de.alpharogroup.db.entity.BaseEntity<PK>,REPOSITORY extends de.alpharogroup.db.repository.api.GenericRepository<E,PK>,M extends EntityDOMapper<E,DO>> extends Object implements DomainService<PK,DO>
AbstractDomainService.| Constructor and Description |
|---|
AbstractDomainService() |
| Modifier and Type | Method and Description |
|---|---|
DO |
create(DO domainObject)
Creates an entity from the given domain object and persist it to the underlying database.
|
DO |
delete(PK id)
Deletes an entity with the given id.
|
boolean |
exists(PK id)
Checks if an entry exists with the given id.
|
List<DO> |
findAll()
Returns a list of all domain objects.
|
Collection<PK> |
persist(Collection<DO> domainObjects)
Persist all new domain objects in the given
Collection. |
DO |
read(PK id)
Read an entity with the given id and maps it to a domain object that will be returned.
|
DO |
update(DO domainObject)
Updates the given domain object to the underlying database.
|
@Transactional public DO create(DO domainObject)
create in interface DomainService<PK extends Serializable,DO extends DomainObject<PK>>domainObject - the domain object@Transactional public DO delete(PK id)
delete in interface DomainService<PK extends Serializable,DO extends DomainObject<PK>>id - the idpublic boolean exists(PK id)
exists in interface DomainService<PK extends Serializable,DO extends DomainObject<PK>>id - the id to checkpublic List<DO> findAll()
findAll in interface DomainService<PK extends Serializable,DO extends DomainObject<PK>>@Transactional public Collection<PK> persist(Collection<DO> domainObjects)
Collection.persist in interface DomainService<PK extends Serializable,DO extends DomainObject<PK>>domainObjects - the Collection of domain objects to persistCollection with the id's of the persisted objectspublic DO read(PK id)
read in interface DomainService<PK extends Serializable,DO extends DomainObject<PK>>id - the id@Transactional public DO update(DO domainObject)
update in interface DomainService<PK extends Serializable,DO extends DomainObject<PK>>domainObject - the domain objectCopyright © 2015–2017 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.