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.
static PersistenceStrategy getPersistenceStrategy(FieldMetaData fmd, Member member)
          Return the code for the strategy of the given member.
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, isDeclaredInterfacePersistent, isReservedFieldName, isUserDefined, setCallbackMode, setCallbackMode, 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

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 Apache Software Foundation. All Rights Reserved.