T - the type of the domain objectPK - the type of the primary key from the domain objectpublic interface BusinessService<T extends de.alpharogroup.db.entity.BaseEntity<PK>,PK extends Serializable> extends Serializable
| Modifier and Type | Method and Description |
|---|---|
Query |
createNativeQuery(String sqlString)
Factory method for create a new instance of
Query from the given sql string and
execute a native sql statement for update or delete. |
Query |
createNativeQuery(String sqlString,
Class resultClass)
Factory method for create a new instance of
Query from the given sql string and
execute a native sql statement. |
Query |
createNativeQuery(String sqlString,
String resultSetMapping)
Factory method for create a new instance of
Query from the given sql string and
execute a native sql statement. |
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 object)
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.
|
EntityManager |
getEntityManager()
Gets the entity manager.
|
Query |
getQuery(String jpqlString)
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 object)
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.
|
Query createNativeQuery(String sqlString)
Query from the given sql string and
execute a native sql statement for update or delete.
Note: this method delegates to the underlying entity manager.sqlString - a native SQL query stringQuery instanceQuery createNativeQuery(String sqlString, Class resultClass)
Query from the given sql string and
execute a native sql statement.
Note: this method delegates to the underlying entity manager.sqlString - a native SQL query stringresultClass - the class of the resulting instance(s)Query instanceQuery createNativeQuery(String sqlString, String resultSetMapping)
Query from the given sql string and
execute a native sql statement.
Note: this method delegates to the underlying entity manager.sqlString - a native SQL query stringresultSetMapping - the name of the result set mappingQuery instancevoid delete(List<T> objects)
objects - the list with the persistent objects to deletevoid delete(PK id)
id - the idvoid delete(T object)
object - the persistent objectvoid evict(T object)
object - the object to evict.boolean exists(PK id)
id - the id to checkT get(PK id)
id - the idEntityManager getEntityManager()
Query getQuery(String jpqlString)
Query from the given string.jpqlString - the jpql query as stringT load(PK id)
id - the idList<T> merge(List<T> objects)
objects - the list to saveT merge(T object)
object - the objectvoid refresh(T object)
object - the object to refresh.List<PK> save(List<T> objects)
objects - the list to savePK save(T object)
object - the new instance to save.void saveOrUpdate(List<T> objects)
objects - the objects to save or update.void saveOrUpdate(T object)
object - the object to save or update.Copyright © 2015–2018 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.