Package org.apache.openjpa.jdbc.meta
Interface Strategy
-
- All Superinterfaces:
java.io.Serializable
- All Known Subinterfaces:
ClassStrategy
,DiscriminatorStrategy
,FieldStrategy
,LRSCollectionFieldStrategy
,LRSMapFieldStrategy
,VersionStrategy
- All Known Implementing Classes:
AbstractClassStrategy
,AbstractDiscriminatorStrategy
,AbstractFieldStrategy
,AbstractStrategy
,AbstractVersionStrategy
,ClassMapping
,ClassNameDiscriminatorStrategy
,ColumnVersionStrategy
,ContainerFieldStrategy
,Discriminator
,EmbeddedClassStrategy
,EmbedFieldStrategy
,FieldMapping
,FlatClassStrategy
,FullClassStrategy
,HandlerCollectionTableFieldStrategy
,HandlerFieldStrategy
,HandlerHandlerMapTableFieldStrategy
,HandlerRelationMapTableFieldStrategy
,InValueDiscriminatorStrategy
,LobFieldStrategy
,MapTableFieldStrategy
,MaxEmbeddedBlobFieldStrategy
,MaxEmbeddedByteArrayFieldStrategy
,MaxEmbeddedCharArrayFieldStrategy
,MaxEmbeddedClobFieldStrategy
,MultiColumnVersionStrategy
,NanoPrecisionTimestampVersionStrategy
,NoneClassStrategy
,NoneDiscriminatorStrategy
,NoneFieldStrategy
,NoneVersionStrategy
,NumberVersionStrategy
,ObjectIdClassStrategy
,PrimitiveFieldStrategy
,RelationCollectionInverseKeyFieldStrategy
,RelationCollectionTableFieldStrategy
,RelationFieldStrategy
,RelationHandlerMapTableFieldStrategy
,RelationMapInverseKeyFieldStrategy
,RelationMapTableFieldStrategy
,RelationRelationMapTableFieldStrategy
,RelationToManyInverseKeyFieldStrategy
,RelationToManyTableFieldStrategy
,StateComparisonVersionStrategy
,StoreCollectionFieldStrategy
,StringFieldStrategy
,SubclassJoinDiscriminatorStrategy
,SuperclassDiscriminatorStrategy
,SuperclassVersionStrategy
,TimestampVersionStrategy
,ValueMapDiscriminatorStrategy
,Version
,VerticalClassStrategy
public interface Strategy extends java.io.Serializable
Interface implemented by all mapping strategies.- Since:
- 0.4.0
- Author:
- Abe White
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
customDelete(OpenJPAStateManager sm, JDBCStore store)
Override this method to customize flushing this mapping.void
customInsert(OpenJPAStateManager sm, JDBCStore store)
Override this method to customize flushing this mapping.void
customUpdate(OpenJPAStateManager sm, JDBCStore store)
Override this method to customize flushing this mapping.void
delete(OpenJPAStateManager sm, JDBCStore store, RowManager rm)
Set the where values appropriately to delete the proper instance, and set all relations on non-secondary tables as updates.java.lang.String
getAlias()
Return the alias of this strategy.void
initialize()
Perform caching and other initialization operations.void
insert(OpenJPAStateManager sm, JDBCStore store, RowManager rm)
Set values for the mapping into the proper rows.java.lang.Boolean
isCustomDelete(OpenJPAStateManager sm, JDBCStore store)
ReturnBoolean.FALSE
if this mapping does not customize the delete process,Boolean.TRUE
if it does, or null if it does customize the delete, but also relies on the standard delete method being called.java.lang.Boolean
isCustomInsert(OpenJPAStateManager sm, JDBCStore store)
ReturnBoolean.FALSE
if this mapping does not customize the insert process,Boolean.TRUE
if it does, or null if it does customize the insert, but also relies on the standard insert method being called.java.lang.Boolean
isCustomUpdate(OpenJPAStateManager sm, JDBCStore store)
ReturnBoolean.FALSE
if this mapping does not customize the update process,Boolean.TRUE
if it does, or null if it does customize the update, but also relies on the standard update method being called.void
map(boolean adapt)
Map the owning mapping using this strategy.void
update(OpenJPAStateManager sm, JDBCStore store, RowManager rm)
Set values for the mapping into the proper rows.
-
-
-
Method Detail
-
getAlias
java.lang.String getAlias()
Return the alias of this strategy. For custom strategies, return the full class name.
-
map
void map(boolean adapt)
Map the owning mapping using this strategy.- Parameters:
adapt
- if true, use the owning mapping's raw mapping info to set its ORM data; if false, ORM data will already be set- Throws:
MetaDataException
- if unable to map
-
initialize
void initialize()
Perform caching and other initialization operations. This method is called aftermap(boolean)
, and after all related components have been mapped as well.
-
insert
void insert(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws java.sql.SQLException
Set values for the mapping into the proper rows. For class mappings, this method will be called only after the corresponding method has been called for all fields of this mapping.- Throws:
java.sql.SQLException
-
update
void update(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws java.sql.SQLException
Set values for the mapping into the proper rows.- Throws:
java.sql.SQLException
- See Also:
insert(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore, org.apache.openjpa.jdbc.sql.RowManager)
-
delete
void delete(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws java.sql.SQLException
Set the where values appropriately to delete the proper instance, and set all relations on non-secondary tables as updates. This allows foreign key analysis.- Throws:
java.sql.SQLException
- See Also:
insert(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore, org.apache.openjpa.jdbc.sql.RowManager)
-
isCustomInsert
java.lang.Boolean isCustomInsert(OpenJPAStateManager sm, JDBCStore store)
ReturnBoolean.FALSE
if this mapping does not customize the insert process,Boolean.TRUE
if it does, or null if it does customize the insert, but also relies on the standard insert method being called. Implement thecustomInsert(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore)
method to implement the custom insertion behavior.
-
isCustomUpdate
java.lang.Boolean isCustomUpdate(OpenJPAStateManager sm, JDBCStore store)
ReturnBoolean.FALSE
if this mapping does not customize the update process,Boolean.TRUE
if it does, or null if it does customize the update, but also relies on the standard update method being called. Implement thecustomUpdate(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore)
method to override the default update behavior.
-
isCustomDelete
java.lang.Boolean isCustomDelete(OpenJPAStateManager sm, JDBCStore store)
ReturnBoolean.FALSE
if this mapping does not customize the delete process,Boolean.TRUE
if it does, or null if it does customize the delete, but also relies on the standard delete method being called. Implement thecustomDelete(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore)
method to override the default deletion behavior.
-
customInsert
void customInsert(OpenJPAStateManager sm, JDBCStore store) throws java.sql.SQLException
Override this method to customize flushing this mapping. For classes, this method must also flush all fields. For fields, this method is called after the owning object is inserted, so if this field is in a row with other fields, that row will already exist.- Throws:
java.sql.SQLException
-
customUpdate
void customUpdate(OpenJPAStateManager sm, JDBCStore store) throws java.sql.SQLException
Override this method to customize flushing this mapping. For classes, this method must also flush all fields.- Throws:
java.sql.SQLException
-
customDelete
void customDelete(OpenJPAStateManager sm, JDBCStore store) throws java.sql.SQLException
Override this method to customize flushing this mapping. For classes, this method must also flush all fields. For fields, this method will be called after the owning object is deleted.- Throws:
java.sql.SQLException
-
-