|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfri.util.database.jpa.commons.DbSessionJpaImpl
public class DbSessionJpaImpl
JPA implementation of DbSession
.
Constructor Summary | |
---|---|
DbSessionJpaImpl(javax.persistence.EntityManager entityManager)
|
Method Summary | |
---|---|
void |
delete(java.lang.Object node)
Deletes passed object from persistence. |
void |
executeUpdate(java.lang.String sqlCommand,
java.lang.Object[] parameters)
Executes an update or delete statement. |
void |
flush()
Flushes all changes to database. |
java.lang.Object |
get(java.lang.Class<?> entityClass,
java.io.Serializable id)
Fast cached read of an object by identity (primary key). |
javax.persistence.EntityManager |
getEntityManager()
Do not use. |
int |
queryCount(java.lang.String queryText,
java.lang.Object[] parameters)
Executes given query and returns the resulting count of found records. |
java.util.List<?> |
queryList(java.lang.String queryText,
java.lang.Object[] parameters)
Executes a query and returns its result list. |
void |
refresh(java.lang.Object node)
Re-reads passed object from persistence. |
java.lang.Object |
save(java.lang.Object node)
Save the passed object to persistence. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DbSessionJpaImpl(javax.persistence.EntityManager entityManager)
Method Detail |
---|
public java.lang.Object get(java.lang.Class<?> entityClass, java.io.Serializable id)
DbSession
get
in interface DbSession
entityClass
- the persistence class of the entity (POJO).id
- the primary key of the entity.
public java.lang.Object save(java.lang.Object node)
DbSession
save
in interface DbSession
node
- the object to save.public void flush()
DbSession
flush
in interface DbSession
public void refresh(java.lang.Object node)
DbSession
refresh
in interface DbSession
node
- the object to refresh.public void delete(java.lang.Object node)
DbSession
delete
in interface DbSession
node
- the object to delete.public java.util.List<?> queryList(java.lang.String queryText, java.lang.Object[] parameters)
DbSession
queryList
in interface DbSession
queryText
- the JPQL text for the query.parameters
- the positional parameters for "?" place-holders in query text.
public int queryCount(java.lang.String queryText, java.lang.Object[] parameters)
DbSession
select count(x) ...
query.
queryCount
in interface DbSession
queryText
- the JPQL text for the query.parameters
- the positional parameters for "?" place-holders in query text.
public void executeUpdate(java.lang.String sqlCommand, java.lang.Object[] parameters)
DbSession
executeUpdate
in interface DbSession
sqlCommand
- the text of the JPQL statement.parameters
- the positional parameters for place-holders in command text.public javax.persistence.EntityManager getEntityManager()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |