org.datanucleus.metadata
Class InterfaceMetaData

java.lang.Object
  extended by org.datanucleus.metadata.MetaData
      extended by org.datanucleus.metadata.AbstractClassMetaData
          extended by org.datanucleus.metadata.InterfaceMetaData
All Implemented Interfaces:
java.io.Serializable

public class InterfaceMetaData
extends AbstractClassMetaData

Representation of the MetaData of a "persistent-interface".

Since:
1.1
Version:
$Revision: 1.44 $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.datanucleus.metadata.AbstractClassMetaData
allMemberPositions, cacheable, catalog, detachable, dfgMemberFlags, dfgMemberPositions, embeddedOnly, entityName, excludeDefaultListeners, excludeSuperClassListeners, fetchGroupMetaData, fetchGroupMetaDataByName, fetchGroups, foreignKeyMetaData, foreignKeys, fullName, identityMetaData, identitySpecified, identityType, implementationOfPersistentDefinition, indexes, indexMetaData, inheritanceMetaData, joinMetaData, joins, listeners, LOCALISER_API, managedMembers, memberCount, memberPositionsByName, members, metaDataComplete, name, nonPkMemberFlags, nonPkMemberPositions, noOfInheritedManagedMembers, objectidClass, overriddenMembers, pcSuperclassMetaData, persistenceCapableSuperclass, persistenceModifier, persistentInterfaceImplNeedingTableFromSubclass, persistentInterfaceImplNeedingTableFromSuperclass, pkMemberPositions, primaryKeyMetaData, queries, queryResultMetaData, relationPositions, requiresExtent, schema, scoMutableMemberFlags, scoMutableMemberPositions, scoNonContainerMemberPositions, secondClassContainerMemberPositions, table, uniqueConstraints, uniqueMetaData, unmappedColumns, usesSingleFieldIdentityClass, versionMetaData
 
Fields inherited from class org.datanucleus.metadata.MetaData
extensions, LOCALISER, METADATA_CREATED_STATE, METADATA_INITIALISED_STATE, METADATA_POPULATED_STATE, METADATA_USED_STATE, metaDataState, parent, VENDOR_NAME, VENDOR_NAME_OLD
 
Constructor Summary
InterfaceMetaData(PackageMetaData parent, java.lang.String name, java.lang.String identityType, java.lang.String objectidClass, java.lang.String requiresExtent, java.lang.String detachable, java.lang.String embeddedOnly, java.lang.String catalog, java.lang.String schema, java.lang.String table, java.lang.String entityName)
          Constructor.
 
Method Summary
protected  void addMetaDataForMembersNotInMetaData(java.lang.Class cls)
          Add MetaData for properties of the interface not declared in MetaData.
 void initialise()
          Method to initialise the object, creating internal convenience arrays.
protected  AbstractMemberMetaData newDefaultedProperty(java.lang.String name)
          Utility to add a defaulted PropertyMetaData to the class.
 void populate(ClassLoaderResolver clr, java.lang.ClassLoader primary)
          Method to provide the details of the class being represented by this MetaData.
protected  void populatePropertyMetaData(ClassLoaderResolver clr, java.lang.Class cls, boolean pkFields, java.lang.ClassLoader primary)
          Populate PropertyMetaData.
 java.lang.String toString(java.lang.String prefix, java.lang.String indent)
          Returns a string representation of the object.
 
Methods inherited from class org.datanucleus.metadata.AbstractClassMetaData
addFetchGroup, addForeignKey, addIndex, addJoin, addListener, addMember, addQuery, addQueryResultMetaData, addUniqueConstraint, addUnmappedColumn, checkInitialised, checkPopulated, copyMembersFromInterface, determineIdentity, determineInheritanceMetaData, determineObjectIdClass, determineSuperClassName, excludeDefaultListeners, excludeSuperClassListeners, getAbsoluteMemberPositionForRelativePosition, getAbsolutePositionOfMember, getAbsolutePositionOfMember, getAllMemberPositions, getBaseAbstractClassMetaData, getBaseIdentityMetaData, getBasicMemberPositions, getBidirectionalRelationMemberPositions, getCatalog, getDFGMemberFlags, getDFGMemberPositions, getDiscriminatorMetaDataForTable, getDiscriminatorStrategy, getEntityName, getFetchGroupMetaData, getFetchGroupMetaData, getFetchGroupMetaData, getForeignKeyMetaData, getFullClassName, getIdentityMetaData, getIdentityType, getIndexMetaData, getInheritanceMetaData, getJoinMetaData, getListenerForClass, getListeners, getManagedMembers, getMemberBeingOverridden, getMemberCount, getMetaDataForManagedMemberAtAbsolutePosition, getMetaDataForManagedMemberAtAbsolutePositionInternal, getMetaDataForManagedMemberAtPosition, getMetaDataForMember, getMetaDataForMemberAtRelativePosition, getMetaDataManager, getMultivaluedMemberPositions, getName, getNonPKMemberFlags, getNonPKMemberPositions, getNoOfInheritedManagedMembers, getNoOfManagedMembers, getNoOfMembers, getNoOfOverriddenMembers, getNoOfPrimaryKeyMembers, getNoOfQueries, getObjectidClass, getOverriddenMember, getOverriddenMember, getOverriddenMembers, getPackageMetaData, getPackageName, getPersistenceCapableSuperclass, getPersistenceModifier, getPKMemberPositions, getPrimaryKeyMemberNames, getPrimaryKeyMetaData, getQueries, getQueryResultMetaData, getRelationMemberPositions, getRelativePositionOfMember, getSchema, getSCOContainerMemberPositions, getSCOMutableMemberFlags, getSCOMutableMemberPositions, getSCONonContainerMemberPositions, getSuperAbstractClassMetaData, getTable, getUniqueMetaData, getUnmappedColumns, getVersionMetaData, getVersionMetaDataForTable, hasDiscriminatorStrategy, hasMember, hasRelations, hasVersionStrategy, inheritDetachableSettings, inheritIdentity, initialiseMemberPositionInformation, isCacheable, isDetachable, isEmbeddedOnly, isExcludeDefaultListeners, isExcludeSuperClassListeners, isImplementationOfPersistentDefinition, isMetaDataComplete, isRequiresExtent, isSameOrAncestorOf, loadClass, setCacheable, setCatalog, setEmbeddedOnly, setIdentityMetaData, setIdentityType, setInheritanceMetaData, setMetaDataComplete, setObjectIdClass, setPrimaryKeyMetaData, setSchema, setTable, setVersionMetaData, usesSingleFieldIdentityClass, validateDeprecatedMetaData, validateObjectIdClass, validateUnmappedColumns, validateUserInputForIdentity, validateUserInputForInheritanceMetaData
 
Methods inherited from class org.datanucleus.metadata.MetaData
addExtension, addExtension, getExtensions, getNoOfExtensions, getParent, getValueForExtension, getValuesForExtension, hasExtension, isInitialised, isPopulated, isUsed, removeExtension, setInitialised, setParent, setPopulated, setUsed, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InterfaceMetaData

public InterfaceMetaData(PackageMetaData parent,
                         java.lang.String name,
                         java.lang.String identityType,
                         java.lang.String objectidClass,
                         java.lang.String requiresExtent,
                         java.lang.String detachable,
                         java.lang.String embeddedOnly,
                         java.lang.String catalog,
                         java.lang.String schema,
                         java.lang.String table,
                         java.lang.String entityName)
Constructor. Takes the basic string information found in the MetaData file.

Parameters:
parent - The package to which this class belongs
name - Name of class
identityType - Type of identity
objectidClass - Class of the object id
requiresExtent - Whether the class requires an extent
detachable - Whether this is detachable
embeddedOnly - embedded-only tag
catalog - Name for catalog
schema - Name for schema
table - Name of the table where to persist objects of this type
entityName - the entity name required by JPA 4.3.1
Method Detail

initialise

public void initialise()
Method to initialise the object, creating internal convenience arrays. Initialises all sub-objects. If populate() is going to be used it should be used BEFORE calling this method.

Specified by:
initialise in class AbstractClassMetaData

populate

public void populate(ClassLoaderResolver clr,
                     java.lang.ClassLoader primary)
Method to provide the details of the class being represented by this MetaData. This can be used to firstly provide defaults for attributes that aren't specified in the MetaData, and secondly to report any errors with attributes that have been specifed that are inconsistent with the class being represented.

One possible use of this method would be to take a basic ClassMetaData for a class and call this, passing in the users class. This would then add AbstractMemberMetaData for all fields in this class providing defaults for all of these.

Specified by:
populate in class AbstractClassMetaData
Parameters:
clr - ClassLoaderResolver to use in loading any classes
primary - the primary ClassLoader to use (or null)

newDefaultedProperty

protected AbstractMemberMetaData newDefaultedProperty(java.lang.String name)
Utility to add a defaulted PropertyMetaData to the class. Provided as a method since then any derived classes can override it.

Overrides:
newDefaultedProperty in class AbstractClassMetaData
Parameters:
name - name of field
Returns:
the new PropertyMetaData

populatePropertyMetaData

protected void populatePropertyMetaData(ClassLoaderResolver clr,
                                        java.lang.Class cls,
                                        boolean pkFields,
                                        java.lang.ClassLoader primary)
Populate PropertyMetaData.

Parameters:
clr - The ClassLoader
cls - This class
pkFields - Process pk fields (or non-PK fields if false)
primary - the primary ClassLoader to use (or null)
Throws:
InvalidMetaDataException - if the Class for a declared type in a field cannot be loaded by the clr
InvalidMetaDataException - if a field declared in the MetaData does not exist in the Class

addMetaDataForMembersNotInMetaData

protected void addMetaDataForMembersNotInMetaData(java.lang.Class cls)
Add MetaData for properties of the interface not declared in MetaData.

Parameters:
cls - Class represented by this metadata

toString

public java.lang.String toString(java.lang.String prefix,
                                 java.lang.String indent)
Returns a string representation of the object. This can be used as part of a facility to output a MetaData file.

Overrides:
toString in class MetaData
Parameters:
prefix - prefix string
indent - indent string
Returns:
a string representation of the object.


Copyright © 2009. All Rights Reserved.