Package org.apache.openjpa.meta
Interface MetaDataDefaults
-
- All Superinterfaces:
CallbackModes
- All Known Implementing Classes:
AbstractMetaDataDefaults,NoneMetaDataFactory,PersistenceMetaDataDefaults
public interface MetaDataDefaults extends CallbackModes
Populates new metadata with default values.- Author:
- Abe White
-
-
Field Summary
-
Fields inherited from interface org.apache.openjpa.event.CallbackModes
CALLBACK_FAIL_FAST, CALLBACK_IGNORE, CALLBACK_LOG, CALLBACK_RETHROW, CALLBACK_ROLLBACK
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.reflect.MembergetBackingMember(FieldMetaData field)Return the backing member for the given field metadata.intgetCallbackMode()What to do on lifecycle callback exceptions.booleangetCallbacksBeforeListeners(int type)If callbacks are fired before listeners for the given event type.intgetDefaultAccessType()Return the default access type for a base persistent class withClassMetaData.ACCESS_UNKNOWNaccess type.intgetDefaultIdentityType()Return the default identity type for unmapped classes without primary key fields.java.lang.StringgetDefaultSchema()Returns the default schema.java.lang.reflect.MembergetMemberByProperty(ClassMetaData meta, java.lang.String attribute, int access, boolean scanAnnotation)Get the field or getter for the given attribute of the given class.java.lang.ClassgetUnimplementedExceptionType()Return a runtime exception class to throw for un-implemented managed interface methods.booleanisAbstractMappingUniDirectional(OpenJPAConfiguration conf)Whether the relationship in MappedSuper class must be uni-directional.booleanisDataStoreObjectIdFieldUnwrapped()Whether the field in the object id class corresponding to a datastore id persistence-capable primary key field is the simple datastore id value of the related instance.booleanisDeclaredInterfacePersistent()Whether declared interfaces of a class are treated as persistent types.java.lang.BooleanisDefaultCascadePersistEnabled()Whether cascade-persist was declared in the persistence unit defaults.booleanisNonDefaultMappingAllowed(OpenJPAConfiguration conf)Whether non-default mapping is allowed.voidpopulate(ClassMetaData meta, int access)Populate the given metadata with default settings.voidpopulate(ClassMetaData meta, int access, boolean ignoreTransient)Populate the given metadata with default settings.voidsetDefaultCascadePersistEnabled(java.lang.Boolean bool)voidsetDefaultSchema(java.lang.String schema)Sets the default schema.voidsetIgnoreNonPersistent(boolean ignore)Whether to ignore members which are not persistent by default during metadata population.
-
-
-
Method Detail
-
getDefaultAccessType
int getDefaultAccessType()
Return the default access type for a base persistent class withClassMetaData.ACCESS_UNKNOWNaccess type.
-
getDefaultIdentityType
int getDefaultIdentityType()
Return the default identity type for unmapped classes without primary key fields.
-
getCallbackMode
int getCallbackMode()
What to do on lifecycle callback exceptions.
-
getCallbacksBeforeListeners
boolean getCallbacksBeforeListeners(int type)
If callbacks are fired before listeners for the given event type. Defaults to false.
-
isDeclaredInterfacePersistent
boolean isDeclaredInterfacePersistent()
Whether declared interfaces of a class are treated as persistent types. Defaults to true.
-
isDataStoreObjectIdFieldUnwrapped
boolean isDataStoreObjectIdFieldUnwrapped()
Whether the field in the object id class corresponding to a datastore id persistence-capable primary key field is the simple datastore id value of the related instance. Defaults to false.
-
setIgnoreNonPersistent
void setIgnoreNonPersistent(boolean ignore)
Whether to ignore members which are not persistent by default during metadata population. Defaults to true.
-
populate
void populate(ClassMetaData meta, int access)
Populate the given metadata with default settings.- Parameters:
access- access type constant fromClassMetaData
-
populate
void populate(ClassMetaData meta, int access, boolean ignoreTransient)
Populate the given metadata with default settings.- Parameters:
access- access type constant fromClassMetaData
-
getBackingMember
java.lang.reflect.Member getBackingMember(FieldMetaData field)
Return the backing member for the given field metadata.
-
getMemberByProperty
java.lang.reflect.Member getMemberByProperty(ClassMetaData meta, java.lang.String attribute, int access, boolean scanAnnotation)
Get the field or getter for the given attribute of the given class.- Parameters:
meta- is the declaring classattribute- name of the logical attributeaccess- whether to look for the field of getter method. If unknown, then field or property is chosen based on the access type used by the given class.scanAnnotation- if true and access is unknown then scans the annotation on the member to determine access.- Since:
- 2.0.0
-
getUnimplementedExceptionType
java.lang.Class getUnimplementedExceptionType()
Return a runtime exception class to throw for un-implemented managed interface methods.
-
isAbstractMappingUniDirectional
boolean isAbstractMappingUniDirectional(OpenJPAConfiguration conf)
Whether the relationship in MappedSuper class must be uni-directional.- Since:
- 2.0.0
-
isNonDefaultMappingAllowed
boolean isNonDefaultMappingAllowed(OpenJPAConfiguration conf)
Whether non-default mapping is allowed.- Since:
- 2.0.0
-
isDefaultCascadePersistEnabled
java.lang.Boolean isDefaultCascadePersistEnabled()
Whether cascade-persist was declared in the persistence unit defaults.
-
setDefaultCascadePersistEnabled
void setDefaultCascadePersistEnabled(java.lang.Boolean bool)
-
getDefaultSchema
java.lang.String getDefaultSchema()
Returns the default schema.- Since:
- 2.2.3
-
setDefaultSchema
void setDefaultSchema(java.lang.String schema)
Sets the default schema.- Since:
- 2.2.3
-
-