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 String
buildPropertyFilterConditionString
(DOFObjectType objectType, DOFPropertyType pt, DOFObjectFilter filter, List<Object> queryValues) Creates the SQL condition string for a property.executeQuery
(DOFObjectType objectType, DOFObjectFilter filter) int
void
static void
initMaxQueryCount
(int value) Sets the maximum number of data items that is read from the database.protected void
insert
(Connection con, DOFObject instance) boolean
boolean
boolean
readDistinctValues
(DOFObjectType objectType, DOFPropertyType property) void
void
protected int
update
(Connection con, DOFObject instance) protected String
updateColumnsListDuringInsert
(String columnsList) protected String
updateConditionDuringExecuteQuery
(String condition) protected String
updateConditionDuringUpdate
(String condition) protected String
protected String
protected String
protected Object
updateValue
(Connection con, DOFPropertyType pt, Object value) protected String
updateValuesListDuringInsert
(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:
save
in interfaceIDOFObjectPersistor
-
remove
- Specified by:
remove
in interfaceIDOFObjectPersistor
-
init
- Specified by:
init
in interfaceIDOFObjectPersistor
-
executeQuery
public IDOFObjectPersistor.QueryResult executeQuery(DOFObjectType objectType, DOFObjectFilter filter) - Specified by:
executeQuery
in 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:
readDistinctValues
in interfaceIDOFObjectPersistor
-
updateConditionDuringExecuteQuery
-
updateSqlDuringReadDistinctValues
-
updateSqlDuringRemove
-
updateSetListDuringUpdate
-
updateConditionDuringUpdate
-
updateColumnsListDuringInsert
-
updateValuesListDuringInsert
-
isAbleToPersistInstances
public boolean isAbleToPersistInstances()- Specified by:
isAbleToPersistInstances
in interfaceIDOFObjectPersistor
-
isAbleToQuery
public boolean isAbleToQuery()- Specified by:
isAbleToQuery
in interfaceIDOFObjectPersistor
-
isPermanent
public boolean isPermanent()- Specified by:
isPermanent
in interfaceIDOFObjectPersistor
-
update
-
insert
- Throws:
SQLException
-
updateValue
-