Class PersistenceQueryProcessor<T>
java.lang.Object
org.eclipse.dirigible.database.persistence.processors.AbstractPersistenceProcessor
org.eclipse.dirigible.database.persistence.processors.entity.PersistenceQueryProcessor<T>
- Type Parameters:
T- the generic type
- All Implemented Interfaces:
IPersistenceProcessor
public class PersistenceQueryProcessor<T> extends AbstractPersistenceProcessor
The Persistence Query Processor.
-
Constructor Summary
Constructors Constructor Description PersistenceQueryProcessor(IEntityManagerInterceptor entityManagerInterceptor)Instantiates a new persistence query processor. -
Method Summary
Modifier and Type Method Description Tfind(Connection connection, PersistenceTableModel tableModel, Class<T> clazz, Object id)Find.List<T>findAll(Connection connection, PersistenceTableModel tableModel, Class<T> clazz)Find all.protected StringgenerateScript(Connection connection, PersistenceTableModel tableModel)Generate script.protected StringgenerateScriptFind(Connection connection, PersistenceTableModel tableModel)Generate script find.protected StringgenerateScriptFindAll(Connection connection, PersistenceTableModel tableModel)Generate script find all.protected StringgenerateScriptLock(Connection connection, PersistenceTableModel tableModel)Generate script lock.protected Tget(Connection connection, PersistenceTableModel tableModel, Class<T> clazz, Object id, String sql)Gets the.Tlock(Connection connection, PersistenceTableModel tableModel, Class<T> clazz, Object id)Lock.List<T>query(Connection connection, PersistenceTableModel tableModel, Class<T> clazz, String sql, List<Object> values)Query.Methods inherited from class org.eclipse.dirigible.database.persistence.processors.AbstractPersistenceProcessor
closePreparedStatement, getEntityManagerInterceptor, getPrimaryKey, getPrimaryKeyModel, getValueFromPojo, openPreparedStatement, setEntityManagerInterceptor, setValue, setValue, setValuePrimaryKey, setValuesFromPojo, setValueToPojo, setValueToPojo, shouldSetColumnValue
-
Constructor Details
-
PersistenceQueryProcessor
Instantiates a new persistence query processor.- Parameters:
entityManagerInterceptor- the entity manager interceptor
-
-
Method Details
-
generateScript
Description copied from class:AbstractPersistenceProcessorGenerate script.- Specified by:
generateScriptin classAbstractPersistenceProcessor- Parameters:
connection- the connectiontableModel- the table model- Returns:
- the string
-
generateScriptFind
Generate script find.- Parameters:
connection- the connectiontableModel- the table model- Returns:
- the string
-
generateScriptLock
Generate script lock.- Parameters:
connection- the connectiontableModel- the table model- Returns:
- the string
-
generateScriptFindAll
Generate script find all.- Parameters:
connection- the connectiontableModel- the table model- Returns:
- the string
-
find
public T find(Connection connection, PersistenceTableModel tableModel, Class<T> clazz, Object id) throws PersistenceExceptionFind.- Parameters:
connection- the connectiontableModel- the table modelclazz- the clazzid- the id- Returns:
- the t
- Throws:
PersistenceException- the persistence exception
-
lock
public T lock(Connection connection, PersistenceTableModel tableModel, Class<T> clazz, Object id) throws PersistenceExceptionLock.- Parameters:
connection- the connectiontableModel- the table modelclazz- the clazzid- the id- Returns:
- the t
- Throws:
PersistenceException- the persistence exception
-
get
protected T get(Connection connection, PersistenceTableModel tableModel, Class<T> clazz, Object id, String sql) throws PersistenceExceptionGets the.- Parameters:
connection- the connectiontableModel- the table modelclazz- the clazzid- the idsql- the sql- Returns:
- the t
- Throws:
PersistenceException- the persistence exception
-
findAll
public List<T> findAll(Connection connection, PersistenceTableModel tableModel, Class<T> clazz) throws PersistenceExceptionFind all.- Parameters:
connection- the connectiontableModel- the table modelclazz- the clazz- Returns:
- the list
- Throws:
PersistenceException- the persistence exception
-
query
public List<T> query(Connection connection, PersistenceTableModel tableModel, Class<T> clazz, String sql, List<Object> values)Query.- Parameters:
connection- the connectiontableModel- the table modelclazz- the clazzsql- the sqlvalues- the values- Returns:
- the list
-