Package org.eclnt.ccaddons.dof.util
Class DOFJdbcPersistor
java.lang.Object
org.eclnt.ccaddons.dof.util.DOFJdbcPersistor
- All Implemented Interfaces:
IDOFObjectPersistor
- Direct Known Subclasses:
DOFJdbcPersistorQueryOnly,DOFJdbcPersistorWithTenant
Persistor that is reflectin a DOF object into a corresponding table.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclnt.ccaddons.dof.IDOFObjectPersistor
IDOFObjectPersistor.QueryResult -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringbuildPropertyFilterConditionString(DOFObjectType objectType, DOFPropertyType pt, DOFObjectFilter filter, List<Object> queryValues) Creates the SQL condition string for a property.executeQuery(DOFObjectType objectType, DOFObjectFilter filter) intvoidstatic voidinitMaxQueryCount(int value) Sets the maximum number of data items that is read from the database.protected voidinsert(Connection con, DOFObject instance) booleanbooleanbooleanreadDistinctValues(DOFObjectType objectType, DOFPropertyType property) voidvoidprotected intupdate(Connection con, DOFObject instance) protected StringupdateColumnsListDuringInsert(String columnsList) protected StringupdateConditionDuringExecuteQuery(String condition) protected StringupdateConditionDuringUpdate(String condition) protected Stringprotected Stringprotected Stringprotected ObjectupdateValue(Connection con, DOFPropertyType pt, Object value) protected StringupdateValuesListDuringInsert(String valuesList)
-
Constructor Details
-
DOFJdbcPersistor
public DOFJdbcPersistor()
-
-
Method Details
-
initMaxQueryCount
public static void initMaxQueryCount(int value) Sets the maximum number of data items that is read from the database. -
getMaxQueryCount
public int getMaxQueryCount() -
save
- Specified by:
savein interfaceIDOFObjectPersistor
-
remove
- Specified by:
removein interfaceIDOFObjectPersistor
-
init
- Specified by:
initin interfaceIDOFObjectPersistor
-
executeQuery
public IDOFObjectPersistor.QueryResult executeQuery(DOFObjectType objectType, DOFObjectFilter filter) - Specified by:
executeQueryin interfaceIDOFObjectPersistor
-
buildPropertyFilterConditionString
protected String buildPropertyFilterConditionString(DOFObjectType objectType, DOFPropertyType pt, DOFObjectFilter filter, List<Object> queryValues) Creates the SQL condition string for a property. The result is inserted in the whole query SQL statement that is built up inexecuteQuery(DOFObjectType, DOFObjectFilter).- Parameters:
queryValues- List of values that represents the values for the prepared statement. A prepared statement contains "?"-placeholder which then are popuplated by the list of objects. Do not directly insert values into the condition string in order to avoid SQL injection!
-
readDistinctValues
- Specified by:
readDistinctValuesin interfaceIDOFObjectPersistor
-
updateConditionDuringExecuteQuery
-
updateSqlDuringReadDistinctValues
-
updateSqlDuringRemove
-
updateSetListDuringUpdate
-
updateConditionDuringUpdate
-
updateColumnsListDuringInsert
-
updateValuesListDuringInsert
-
isAbleToPersistInstances
public boolean isAbleToPersistInstances()- Specified by:
isAbleToPersistInstancesin interfaceIDOFObjectPersistor
-
isAbleToQuery
public boolean isAbleToQuery()- Specified by:
isAbleToQueryin interfaceIDOFObjectPersistor
-
isPermanent
public boolean isPermanent()- Specified by:
isPermanentin interfaceIDOFObjectPersistor
-
update
-
insert
- Throws:
SQLException
-
updateValue
-