|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.lazydog.repository.jpa.AbstractRepository
public abstract class AbstractRepository
Abstract repository implemented using the Java Persistence API.
| Constructor Summary | |
|---|---|
AbstractRepository()
|
|
| Method Summary | ||
|---|---|---|
|
find(Class<T> entityClass,
Criteria<T> criteria)
Find the entity. |
|
protected
|
find(Class<T> entityClass,
String queryLanguageString,
Map<String,Object> queryParameters,
Map<Object,String> queryHints)
Find the entity. |
|
|
find(Class<T> entityClass,
U id)
Find the entity. |
|
|
findList(Class<T> entityClass)
Find the list of entities. |
|
|
findList(Class<T> entityClass,
Criteria<T> criteria)
Find the list of entities. |
|
protected
|
findList(Class<T> entityClass,
String queryLanguageString,
Map<String,Object> queryParameters,
Map<Object,String> queryHints)
Find the list of entities. |
|
protected Connection |
getConnection()
Get the connection. |
|
|
getCriteria(Class<T> entityClass)
Get the criteria. |
|
protected javax.persistence.EntityManager |
getEntityManager()
Get the entity manager. |
|
|
persist(T entity)
Persist the entity. |
|
|
persistList(List<T> entities)
Persist the list of entities. |
|
|
remove(Class<T> entityClass,
U id)
Remove the entity. |
|
|
removeList(Class<T> entityClass,
List<U> ids)
Remove the entities by the list of IDs. |
|
protected void |
setEntityManager(javax.persistence.EntityManager entityManager)
Set the entity manager. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractRepository()
| Method Detail |
|---|
public <T,U> T find(Class<T> entityClass,
U id)
find in interface RepositoryentityClass - the entity class.id - the ID.
public <T> T find(Class<T> entityClass,
Criteria<T> criteria)
find in interface RepositoryentityClass - the entity class.criteria - the criteria.
protected <T> T find(Class<T> entityClass,
String queryLanguageString,
Map<String,Object> queryParameters,
Map<Object,String> queryHints)
entityClass - the entity class.queryLanguageString - the query language string.queryParameters - the query parameter map.queryHints - the query hint map.
public <T> List<T> findList(Class<T> entityClass)
findList in interface RepositoryentityClass - the entity class.
public <T> List<T> findList(Class<T> entityClass,
Criteria<T> criteria)
findList in interface RepositoryentityClass - the entity class.criteria - the criteria.
protected <T> List<T> findList(Class<T> entityClass,
String queryLanguageString,
Map<String,Object> queryParameters,
Map<Object,String> queryHints)
entityClass - the entity class.queryLanguageString - the query language string.queryParameters - the query parameter map.queryHints - the query hint map.
protected Connection getConnection()
public <T> Criteria<T> getCriteria(Class<T> entityClass)
getCriteria in interface RepositoryentityClass - the entity class.
protected javax.persistence.EntityManager getEntityManager()
public <T> T persist(T entity)
persist in interface Repositoryentity - the entity.
public <T> List<T> persistList(List<T> entities)
persistList in interface Repositoryentities - the entities.
public <T,U> void remove(Class<T> entityClass,
U id)
remove in interface RepositoryentityClass - the entity class.id - the ID.
public <T,U> void removeList(Class<T> entityClass,
List<U> ids)
removeList in interface RepositoryentityClass - the entity class.ids - the IDs.protected void setEntityManager(javax.persistence.EntityManager entityManager)
entityManager - the entity manager.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||