public class BackingStoreHelper extends Object
Constructor and Description |
---|
BackingStoreHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
appendWhereClauseForElement(StringBuilder stmt,
JavaTypeMapping elementMapping,
Object element,
boolean elementsSerialised,
String containerAlias,
boolean firstWhereClause)
Convenience method to add a WHERE clause to match an element.
|
static void |
appendWhereClauseForMapping(StringBuilder stmt,
JavaTypeMapping mapping,
String containerAlias,
boolean firstWhereClause)
Convenience method to add a WHERE clause restricting the specified mapping.
|
static int |
populateElementDiscriminatorInStatement(org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
int jdbcPosition,
boolean includeSubclasses,
ElementContainerStore.ElementInfo info,
org.datanucleus.ClassLoaderResolver clr)
Convenience method to populate the passed PreparedStatement with the value from the element
discriminator, optionally including all subclasses of the element type.
|
static int |
populateElementForWhereClauseInStatement(org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
Object element,
int jdbcPosition,
JavaTypeMapping elementMapping)
Convenience method to populate the passed PreparedStatement with the value for the element in a WHERE clause.
|
static int |
populateElementInStatement(org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
Object element,
int jdbcPosition,
JavaTypeMapping elementMapping)
Convenience method to populate the passed PreparedStatement with the value for the element.
|
static int |
populateEmbeddedElementFieldsInStatement(org.datanucleus.state.ObjectProvider op,
Object element,
PreparedStatement ps,
int jdbcPosition,
org.datanucleus.metadata.AbstractMemberMetaData ownerFieldMetaData,
JavaTypeMapping elementMapping,
org.datanucleus.metadata.AbstractClassMetaData emd,
BaseContainerStore bcs)
Convenience method to populate the passed PreparedStatement with the field values from
the embedded element starting at the specified jdbc position.
|
static int |
populateEmbeddedKeyFieldsInStatement(org.datanucleus.state.ObjectProvider op,
Object key,
PreparedStatement ps,
int jdbcPosition,
JoinTable joinTable,
AbstractMapStore mapStore)
Convenience method to populate the passed PreparedStatement with the field values from
the embedded map key starting at the specified jdbc position.
|
static int |
populateEmbeddedValueFieldsInStatement(org.datanucleus.state.ObjectProvider op,
Object value,
PreparedStatement ps,
int jdbcPosition,
JoinTable joinTable,
AbstractMapStore mapStore)
Convenience method to populate the passed PreparedStatement with the field values from
the embedded map value starting at the specified jdbc position.
|
static int |
populateKeyInStatement(org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
Object key,
int jdbcPosition,
JavaTypeMapping keyMapping)
Convenience method to populate the passed PreparedStatement with the value for the map key.
|
static int |
populateOrderInStatement(org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
int idx,
int jdbcPosition,
JavaTypeMapping orderMapping)
Convenience method to populate the passed PreparedStatement with the value for the order index.
|
static int |
populateOwnerInStatement(org.datanucleus.state.ObjectProvider op,
org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
int jdbcPosition,
BaseContainerStore bcs)
Convenience method to populate the passed PreparedStatement with the value from the owner.
|
static int |
populateRelationDiscriminatorInStatement(org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
int jdbcPosition,
ElementContainerStore ecs)
Convenience method to populate the passed PreparedStatement with the value for the distinguisher
value.
|
static int |
populateValueInStatement(org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
Object value,
int jdbcPosition,
JavaTypeMapping valueMapping)
Convenience method to populate the passed PreparedStatement with the value for the map value.
|
public static int populateOwnerInStatement(org.datanucleus.state.ObjectProvider op, org.datanucleus.ExecutionContext ec, PreparedStatement ps, int jdbcPosition, BaseContainerStore bcs)
op
- ObjectProviderec
- execution contextps
- The PreparedStatementjdbcPosition
- Position in JDBC statement to populatebcs
- Base container backing storepublic static int populateRelationDiscriminatorInStatement(org.datanucleus.ExecutionContext ec, PreparedStatement ps, int jdbcPosition, ElementContainerStore ecs)
ec
- execution contextps
- The PreparedStatementjdbcPosition
- Position in JDBC statement to populateecs
- storepublic static int populateOrderInStatement(org.datanucleus.ExecutionContext ec, PreparedStatement ps, int idx, int jdbcPosition, JavaTypeMapping orderMapping)
ec
- execution contextps
- The PreparedStatementidx
- The order valuejdbcPosition
- Position in JDBC statement to populateorderMapping
- The order mappingpublic static int populateElementInStatement(org.datanucleus.ExecutionContext ec, PreparedStatement ps, Object element, int jdbcPosition, JavaTypeMapping elementMapping)
ec
- execution contextps
- The PreparedStatementelement
- The elementjdbcPosition
- Position in JDBC statement to populateelementMapping
- mapping for the elementpublic static int populateElementForWhereClauseInStatement(org.datanucleus.ExecutionContext ec, PreparedStatement ps, Object element, int jdbcPosition, JavaTypeMapping elementMapping)
ec
- execution contextps
- The PreparedStatementelement
- The elementjdbcPosition
- Position in JDBC statement to populateelementMapping
- mapping for the elementpublic static int populateKeyInStatement(org.datanucleus.ExecutionContext ec, PreparedStatement ps, Object key, int jdbcPosition, JavaTypeMapping keyMapping)
ec
- execution contextps
- The PreparedStatementkey
- The keyjdbcPosition
- Position in JDBC statement to populatekeyMapping
- The key mappingpublic static int populateValueInStatement(org.datanucleus.ExecutionContext ec, PreparedStatement ps, Object value, int jdbcPosition, JavaTypeMapping valueMapping)
ec
- execution contextps
- The PreparedStatementvalue
- The valuejdbcPosition
- Position in JDBC statement to populatevalueMapping
- The value mappingpublic static int populateElementDiscriminatorInStatement(org.datanucleus.ExecutionContext ec, PreparedStatement ps, int jdbcPosition, boolean includeSubclasses, ElementContainerStore.ElementInfo info, org.datanucleus.ClassLoaderResolver clr)
ec
- execution contextps
- The PreparedStatementjdbcPosition
- Position in JDBC statement to populateincludeSubclasses
- Whether to include subclassesinfo
- The element informationclr
- ClassLoader resolverpublic static int populateEmbeddedElementFieldsInStatement(org.datanucleus.state.ObjectProvider op, Object element, PreparedStatement ps, int jdbcPosition, org.datanucleus.metadata.AbstractMemberMetaData ownerFieldMetaData, JavaTypeMapping elementMapping, org.datanucleus.metadata.AbstractClassMetaData emd, BaseContainerStore bcs)
op
- ObjectProvider of the owning containerelement
- The embedded elementps
- The PreparedStatementjdbcPosition
- JDBC position in the statement to start atownerFieldMetaData
- The meta data for the owner fieldelementMapping
- mapping for the elementemd
- Metadata for the element classbcs
- Container storepublic static int populateEmbeddedKeyFieldsInStatement(org.datanucleus.state.ObjectProvider op, Object key, PreparedStatement ps, int jdbcPosition, JoinTable joinTable, AbstractMapStore mapStore)
op
- ObjectProvider of the owning containerkey
- The embedded keyps
- The PreparedStatementjdbcPosition
- JDBC position in the statement to start atjoinTable
- The Join table where the values are embeddedmapStore
- the map storepublic static int populateEmbeddedValueFieldsInStatement(org.datanucleus.state.ObjectProvider op, Object value, PreparedStatement ps, int jdbcPosition, JoinTable joinTable, AbstractMapStore mapStore)
op
- ObjectProvider of the owning containervalue
- The embedded valueps
- The PreparedStatementjdbcPosition
- JDBC position in the statement to start atjoinTable
- The Join table where the values are embeddedmapStore
- The map storepublic static void appendWhereClauseForElement(StringBuilder stmt, JavaTypeMapping elementMapping, Object element, boolean elementsSerialised, String containerAlias, boolean firstWhereClause)
stmt
- The statement so far that we append toelementMapping
- Mapping for the elementelement
- The element to matchelementsSerialised
- Whether the elements are stored serialisedcontainerAlias
- Any alias for the container of this mappingfirstWhereClause
- Whether this is the first WHERE clause (i.e omit the first "AND")public static void appendWhereClauseForMapping(StringBuilder stmt, JavaTypeMapping mapping, String containerAlias, boolean firstWhereClause)
"[AND] MYFIELD1 = ? [AND MYFIELD2 = ?]"
stmt
- The statement to append ontomapping
- The mapping to restrictcontainerAlias
- Any alias for the container of this mappingfirstWhereClause
- Whether this is the first WHERE clause (i.e omit the first "AND")Copyright © 2017. All rights reserved.