public abstract class AbstractPersistenceProcessor extends Object implements IPersistenceProcessor
| Modifier | Constructor and Description |
|---|---|
|
AbstractPersistenceProcessor()
Instantiates a new abstract persistence processor.
|
protected |
AbstractPersistenceProcessor(IEntityManagerInterceptor entityManagerInterceptor)
Instantiates a new abstract persistence processor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
closePreparedStatement(PreparedStatement preparedStatement)
Close prepared statement.
|
protected abstract String |
generateScript(Connection connection,
PersistenceTableModel tableModel)
Generate script.
|
IEntityManagerInterceptor |
getEntityManagerInterceptor()
Gets the entity manager interceptor.
|
protected String |
getPrimaryKey(PersistenceTableModel tableModel)
Gets the primary key.
|
protected PersistenceTableColumnModel |
getPrimaryKeyModel(PersistenceTableModel tableModel)
Gets the primary key model.
|
protected Object |
getValueFromPojo(Object pojo,
PersistenceTableColumnModel columnModel)
Gets the value from pojo.
|
protected PreparedStatement |
openPreparedStatement(Connection connection,
String sql)
Open prepared statement.
|
void |
setEntityManagerInterceptor(IEntityManagerInterceptor entityManagerInterceptor)
Sets the entity manager interceptor.
|
protected void |
setValue(PreparedStatement preparedStatement,
int i,
Object value)
Sets the value.
|
protected void |
setValue(PreparedStatement preparedStatement,
int i,
String dataType,
Object value)
Sets the value.
|
protected void |
setValuePrimaryKey(PersistenceTableModel tableModel,
Object id,
PreparedStatement preparedStatement)
Sets the value primary key.
|
protected void |
setValuesFromPojo(PersistenceTableModel tableModel,
Object pojo,
PreparedStatement preparedStatement)
Sets the values from pojo.
|
protected void |
setValueToPojo(Object pojo,
Object value,
PersistenceTableColumnModel columnModel)
Sets the value to pojo.
|
protected void |
setValueToPojo(Object pojo,
ResultSet resultSet,
PersistenceTableColumnModel columnModel)
Sets the value to pojo.
|
protected boolean |
shouldSetColumnValue(PersistenceTableColumnModel columnModel)
Should set column value.
|
public AbstractPersistenceProcessor()
protected AbstractPersistenceProcessor(IEntityManagerInterceptor entityManagerInterceptor)
entityManagerInterceptor - the entity manager interceptorprotected abstract String generateScript(Connection connection, PersistenceTableModel tableModel)
connection - the connectiontableModel - the table modelprotected void setValuesFromPojo(PersistenceTableModel tableModel, Object pojo, PreparedStatement preparedStatement) throws SQLException, NoSuchFieldException, IllegalAccessException
tableModel - the table modelpojo - the pojopreparedStatement - the prepared statementSQLException - the SQL exceptionNoSuchFieldException - the no such field exceptionIllegalAccessException - the illegal access exceptionprotected boolean shouldSetColumnValue(PersistenceTableColumnModel columnModel)
columnModel - the column modelprotected void setValuePrimaryKey(PersistenceTableModel tableModel, Object id, PreparedStatement preparedStatement) throws SQLException, NoSuchFieldException, IllegalAccessException
tableModel - the table modelid - the idpreparedStatement - the prepared statementSQLException - the SQL exceptionNoSuchFieldException - the no such field exceptionIllegalAccessException - the illegal access exceptionprotected void setValue(PreparedStatement preparedStatement, int i, Object value) throws SQLException
preparedStatement - the prepared statementi - the ivalue - the valueSQLException - the SQL exceptionprotected void setValue(PreparedStatement preparedStatement, int i, String dataType, Object value) throws SQLException
preparedStatement - the prepared statementi - the idataType - the data typevalue - the valueSQLException - the SQL exceptionprotected void setValueToPojo(Object pojo, ResultSet resultSet, PersistenceTableColumnModel columnModel) throws NoSuchFieldException, SQLException, IllegalAccessException, IOException
pojo - the pojoresultSet - the result setcolumnModel - the column modelNoSuchFieldException - the no such field exceptionSQLException - the SQL exceptionIllegalAccessException - the illegal access exceptionIOExceptionprotected void setValueToPojo(Object pojo, Object value, PersistenceTableColumnModel columnModel) throws NoSuchFieldException, SQLException, IllegalAccessException, IOException
pojo - the pojovalue - the valuecolumnModel - the column modelNoSuchFieldException - the no such field exceptionSQLException - the SQL exceptionIllegalAccessException - the illegal access exceptionIOExceptionprotected Object getValueFromPojo(Object pojo, PersistenceTableColumnModel columnModel) throws NoSuchFieldException, SQLException, IllegalAccessException
pojo - the pojocolumnModel - the column modelNoSuchFieldException - the no such field exceptionSQLException - the SQL exceptionIllegalAccessException - the illegal access exceptionprotected PreparedStatement openPreparedStatement(Connection connection, String sql) throws SQLException
connection - the connectionsql - the sqlSQLException - the SQL exceptionprotected void closePreparedStatement(PreparedStatement preparedStatement)
preparedStatement - the prepared statementprotected String getPrimaryKey(PersistenceTableModel tableModel)
tableModel - the table modelprotected PersistenceTableColumnModel getPrimaryKeyModel(PersistenceTableModel tableModel)
tableModel - the table modelpublic IEntityManagerInterceptor getEntityManagerInterceptor()
public void setEntityManagerInterceptor(IEntityManagerInterceptor entityManagerInterceptor)
entityManagerInterceptor - the new entity manager interceptorCopyright © 2010–2018 Eclipse Foundation. All rights reserved.