org.apache.openjpa.persistence
Class PersistenceMetaDataDefaults

java.lang.Object
  extended by org.apache.openjpa.meta.AbstractMetaDataDefaults
      extended by org.apache.openjpa.persistence.PersistenceMetaDataDefaults
All Implemented Interfaces:
CallbackModes, MetaDataDefaults

public class PersistenceMetaDataDefaults
extends AbstractMetaDataDefaults

JPA-based metadata defaults.

Author:
Patrick Linskey, Abe White

Field Summary
 
Fields inherited from interface org.apache.openjpa.event.CallbackModes
CALLBACK_FAIL_FAST, CALLBACK_IGNORE, CALLBACK_LOG, CALLBACK_RETHROW, CALLBACK_ROLLBACK
 
Constructor Summary
PersistenceMetaDataDefaults()
           
 
Method Summary
protected  int getAccessType(ClassMetaData meta)
          Return the access type of the given metadata.
 boolean getAllowsMultipleMethodsForSameCallback()
          Flags if multiple methods of the same class can handle the same callback event.
protected  List getFieldAccessNames(ClassMetaData meta)
          Return the list of fields in meta that use field access, or null if a list of fields is unobtainable.
static PersistenceStrategy getPersistenceStrategy(FieldMetaData fmd, Member member)
          Return the code for the strategy of the given member.
protected  List getPropertyAccessNames(ClassMetaData meta)
          Return the list of methods in meta that use property access, or null if a list of methods is unobtainable.
protected  boolean isDefaultPersistent(ClassMetaData meta, Member member, String name)
          Return true if the given member is persistent by default.
 void populate(ClassMetaData meta, int access)
          Populate the given metadata with default settings.
protected  void populate(FieldMetaData fmd)
          Populate initial field data.
 void setAllowsMultipleMethodsForSameCallback(boolean flag)
          Flags if multiple methods of the same class can handle the same callback event.
 void setDefaultAccessType(String type)
          Auto-configuration method for the default access type of base classes with ACCESS_UNKNOWN
 
Methods inherited from class org.apache.openjpa.meta.AbstractMetaDataDefaults
getBackingMember, getCallbackMode, getCallbacksBeforeListeners, getDefaultAccessType, getDefaultIdentityType, getFieldName, getIgnoreNonPersistent, getUnimplementedExceptionType, getUsePCRegistry, isDataStoreObjectIdFieldUnwrapped, isDeclaredInterfacePersistent, isReservedFieldName, isUserDefined, setCallbackMode, setCallbackMode, setDataStoreObjectIdFieldUnwrapped, setDeclaredInterfacePersistent, setDefaultAccessType, setDefaultIdentityType, setIgnoreNonPersistent, setUsePCRegistry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistenceMetaDataDefaults

public PersistenceMetaDataDefaults()
Method Detail

getPersistenceStrategy

public static PersistenceStrategy getPersistenceStrategy(FieldMetaData fmd,
                                                         Member member)
Return the code for the strategy of the given member. Return null if no strategy.


getAllowsMultipleMethodsForSameCallback

public boolean getAllowsMultipleMethodsForSameCallback()
Flags if multiple methods of the same class can handle the same callback event.


setAllowsMultipleMethodsForSameCallback

public void setAllowsMultipleMethodsForSameCallback(boolean flag)
Flags if multiple methods of the same class can handle the same callback event.


setDefaultAccessType

public void setDefaultAccessType(String type)
Auto-configuration method for the default access type of base classes with ACCESS_UNKNOWN


populate

public void populate(ClassMetaData meta,
                     int access)
Description copied from interface: MetaDataDefaults
Populate the given metadata with default settings.

Specified by:
populate in interface MetaDataDefaults
Overrides:
populate in class AbstractMetaDataDefaults
access - access type constant from ClassMetaData

populate

protected void populate(FieldMetaData fmd)
Description copied from class: AbstractMetaDataDefaults
Populate initial field data. Does nothing by default.

Overrides:
populate in class AbstractMetaDataDefaults

getAccessType

protected int getAccessType(ClassMetaData meta)
Description copied from class: AbstractMetaDataDefaults
Return the access type of the given metadata. May be a bitwise combination of field and property access constants, or ACCESS_UNKNOWN. Returns ACCESS_FIELD by default.

Overrides:
getAccessType in class AbstractMetaDataDefaults

getFieldAccessNames

protected List getFieldAccessNames(ClassMetaData meta)
Description copied from class: AbstractMetaDataDefaults
Return the list of fields in meta that use field access, or null if a list of fields is unobtainable. An empty list should be returned if the list of fields is obtainable, but there happens to be no field access in meta. This is used for error reporting purposes only, so need not be efficient. This implementation returns null.

Overrides:
getFieldAccessNames in class AbstractMetaDataDefaults

getPropertyAccessNames

protected List getPropertyAccessNames(ClassMetaData meta)
Description copied from class: AbstractMetaDataDefaults
Return the list of methods in meta that use property access, or null if a list of methods is unobtainable. An empty list should be returned if the list of methods is obtainable, but there happens to be no property access in meta. This is used for error reporting purposes only, so need not be efficient. This implementation returns null.

Overrides:
getPropertyAccessNames in class AbstractMetaDataDefaults

isDefaultPersistent

protected boolean isDefaultPersistent(ClassMetaData meta,
                                      Member member,
                                      String name)
Description copied from class: AbstractMetaDataDefaults
Return true if the given member is persistent by default. This will only be invoked on members of the right type (field vs. method). Returns false if member is static or final by default.

Specified by:
isDefaultPersistent in class AbstractMetaDataDefaults
name - the field name from AbstractMetaDataDefaults.getFieldName(java.lang.reflect.Member)


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.