Class RelationStrategies
- java.lang.Object
-
- org.apache.openjpa.jdbc.meta.strats.RelationStrategies
-
public class RelationStrategies extends java.lang.Object
Helper methods for relation mappings.- Author:
- Abe White
-
-
Constructor Summary
Constructors Constructor Description RelationStrategies()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static OpenJPAStateManager
getStateManager(java.lang.Object obj, StoreContext ctx)
Return the state manager for the given instance, using a detached state manager if the instnace is not managed.static boolean
isRelationId(Column[] cols)
Affirms if all of the given columns represent a relationship identifier.static boolean
isRelationId(ForeignKey fk)
Affirms if all of the foreign key columns represent a relationship identifier.static void
mapRelationToUnmappedPC(ValueMapping vm, java.lang.String name, boolean adapt)
Map a logical foreign key to an unmapped base class relation.static void
mapRelationToUnmappedPC(ValueMapping vm, DBIdentifier name, boolean adapt)
static java.lang.Object
toDataStoreValue(ValueMapping vm, java.lang.Object val, JDBCStore store)
Return the given object as its foreign key values.static MetaDataException
uninversable(ValueMapping vm)
Return an exception indicating that the relation is invalid because it has is based on an inverse foreign key and has independent subclasses.static MetaDataException
unjoinable(ValueMapping vm)
Return an exception indicating that we cannot join to the given relation.static MetaDataException
unloadable(ValueMapping vm)
Return an exception indicating that the relation cannot be loaded because it has independent subclasses and does not represent a full oid.
-
-
-
Method Detail
-
unjoinable
public static MetaDataException unjoinable(ValueMapping vm)
Return an exception indicating that we cannot join to the given relation.
-
unloadable
public static MetaDataException unloadable(ValueMapping vm)
Return an exception indicating that the relation cannot be loaded because it has independent subclasses and does not represent a full oid.
-
uninversable
public static MetaDataException uninversable(ValueMapping vm)
Return an exception indicating that the relation is invalid because it has is based on an inverse foreign key and has independent subclasses.
-
toDataStoreValue
public static java.lang.Object toDataStoreValue(ValueMapping vm, java.lang.Object val, JDBCStore store)
Return the given object as its foreign key values.
-
mapRelationToUnmappedPC
public static void mapRelationToUnmappedPC(ValueMapping vm, java.lang.String name, boolean adapt)
Map a logical foreign key to an unmapped base class relation.
-
mapRelationToUnmappedPC
public static void mapRelationToUnmappedPC(ValueMapping vm, DBIdentifier name, boolean adapt)
-
getStateManager
public static OpenJPAStateManager getStateManager(java.lang.Object obj, StoreContext ctx)
Return the state manager for the given instance, using a detached state manager if the instnace is not managed.
-
isRelationId
public static boolean isRelationId(Column[] cols)
Affirms if all of the given columns represent a relationship identifier.
-
isRelationId
public static boolean isRelationId(ForeignKey fk)
Affirms if all of the foreign key columns represent a relationship identifier.
-
-