public class ClassView extends ViewImpl implements DatastoreClass
columns, columnsByName, dba, existsInDatastore, identifier, state, storeMgr, TABLE_STATE_INITIALIZED, TABLE_STATE_INITIALIZED_MODIFIED, TABLE_STATE_NEW, TABLE_STATE_PK_INITIALIZED, TABLE_STATE_VALIDATED
Constructor and Description |
---|
ClassView(DatastoreIdentifier tableName,
RDBMSStoreManager storeMgr,
org.datanucleus.metadata.ClassMetaData cmd)
Constructor for class view.
|
Modifier and Type | Method and Description |
---|---|
DatastoreClass |
getBaseDatastoreClass()
Accessor for the base datastore class.
|
DatastoreClass |
getBaseDatastoreClassWithMember(org.datanucleus.metadata.AbstractMemberMetaData mmd)
Accessor for the base datastore class (table) managing the given field.
|
JavaTypeMapping |
getDatastoreIdMapping()
Accessor for the datastore identity id mapping.
|
JavaTypeMapping |
getDiscriminatorMapping(boolean allowSuperclasses)
Accessor for the discriminator mapping specified .
|
org.datanucleus.metadata.DiscriminatorMetaData |
getDiscriminatorMetaData()
Accessor for Discriminator MetaData
|
JavaTypeMapping |
getExternalMapping(org.datanucleus.metadata.AbstractMemberMetaData fmd,
int mappingType)
Accessor for the external mapping for the specified field of the specified type.
|
org.datanucleus.metadata.AbstractMemberMetaData |
getFieldMetaData(String fieldName)
Accessor for the MetaData for the named field
|
org.datanucleus.metadata.IdentityType |
getIdentityType()
Accessor for the identity type in use.
|
JavaTypeMapping |
getIdMapping()
Accessor for a mapping for the ID.
|
String[] |
getManagedClasses()
Accessor for the names of all classes managed by this table.
|
JavaTypeMapping |
getMemberMapping(org.datanucleus.metadata.AbstractMemberMetaData mmd)
Accessor for the mapping for the specified field/property.
|
JavaTypeMapping |
getMemberMapping(String fieldName)
Accessor for the field mapping for the specified field name.
|
JavaTypeMapping |
getMemberMappingInDatastoreClass(org.datanucleus.metadata.AbstractMemberMetaData mmd)
Accessor for the mapping for the specified field only in this datastore class.
|
org.datanucleus.metadata.AbstractMemberMetaData |
getMetaDataForExternalMapping(JavaTypeMapping mapping,
int mappingType)
Accessor for the owner field metadata for the specified external mapping of the
specified type
|
Collection |
getSecondaryDatastoreClasses()
Accessor for any secondary tables for this table.
|
protected List |
getSQLCreateStatements(Properties props)
Method to return the necessary SQL create statements for this table.
|
DatastoreClass |
getSuperDatastoreClass()
Accessor for the supertable for this table.
|
String |
getType()
Accessor for the type of the class being represented by this view.
|
JavaTypeMapping |
getVersionMapping(boolean allowSuperclasses)
Accessor for the version mapping specified .
|
org.datanucleus.metadata.VersionMetaData |
getVersionMetaData()
Accessor for Version MetaData
|
void |
initialize(org.datanucleus.ClassLoaderResolver clr)
Method to initialise the view.
|
boolean |
isBaseDatastoreClass()
Accessor for whether this is a base datastore class (root in a hierarchy).
|
boolean |
isObjectIdDatastoreAttributed()
Accessor for whether the object ID is attributed in the datastore.
|
boolean |
isSuperDatastoreClass(DatastoreClass table)
Accessor whether the supplied DatastoreClass is a supertable of this table.
|
boolean |
managesClass(String className)
Accessor for whether this table manages the specified class
|
boolean |
managesMapping(JavaTypeMapping mapping)
Convenience method to return if this table manages the columns for the supplied mapping.
|
void |
postInitialize(org.datanucleus.ClassLoaderResolver clr)
Post initilize.
|
void |
provideDatastoreIdMappings(MappingConsumer consumer)
Accessor for a mapping for the datastore ID (OID) for this table.
|
void |
provideDiscriminatorMappings(MappingConsumer consumer)
Provide the mappings to discriminator mappings
|
void |
provideExternalMappings(MappingConsumer consumer,
int mappingType)
Instruction to provide all external mappings to the passed consumer.
|
void |
provideMappingsForMembers(MappingConsumer consumer,
org.datanucleus.metadata.AbstractMemberMetaData[] fieldNumbers,
boolean includeSecondaryTables)
Provide the mappings to the consumer for all specified members.
|
void |
provideMultitenancyMapping(MappingConsumer consumer)
Provide the mapping for multitenancy discriminator (if any).
|
void |
provideNonPrimaryKeyMappings(MappingConsumer consumer)
Provide the mappings to the consumer for all non primary-key fields mapped to this table.
|
void |
providePrimaryKeyMappings(MappingConsumer consumer)
Provide the mappings to the consumer for all primary-key fields mapped to
this table (for application identity).
|
void |
provideUnmappedColumns(MappingConsumer consumer)
Method to provide all unmapped datastore fields (columns) to the consumer.
|
void |
provideVersionMappings(MappingConsumer consumer)
Provide the mappings to version mappings
|
addColumnInternal, getSQLDropStatements, preInitialize, validate
addColumn, allowDDLOutput, assertIsInitialized, assertIsInitializedModified, assertIsPKInitialized, assertIsPKUninitialized, assertIsUninitialized, assertIsValidated, create, drop, equals, executeDdlStatement, executeDdlStatementList, exists, getCatalogName, getClassMetaData, getColumn, getColumnForName, getColumnForPosition, getColumns, getDatastoreIdColumn, getDatastoreIdentifierFullyQualified, getDiscriminatorColumn, getIdentifier, getMemberColumnMappingForEmbeddedMember, getMemberColumnMappingForMember, getMemberColumnMappings, getMultitenancyColumn, getMultitenancyMapping, getName, getNumberOfColumns, getSchemaName, getStoreManager, getVersionColumn, hasColumn, hasColumnName, hashCode, isInitialized, isInitializedModified, isPKInitialized, isValidated, tableExistsInDatastore, toString
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
toString
addColumn, create, drop, exists, getColumn, getIdentifier, getMultitenancyMapping, getStoreManager, hasColumn, isInitialized, isInitializedModified, isValidated, preInitialize, validate
getCatalogName, getClassMetaData, getColumnForName, getColumnForPosition, getColumns, getDatastoreIdColumn, getDiscriminatorColumn, getMemberColumnMappingForEmbeddedMember, getMemberColumnMappingForMember, getMemberColumnMappings, getMultitenancyColumn, getName, getNumberOfColumns, getSchemaName, getVersionColumn
public ClassView(DatastoreIdentifier tableName, RDBMSStoreManager storeMgr, org.datanucleus.metadata.ClassMetaData cmd)
tableName
- The name of the view.storeMgr
- The RDBMS manager managing this viewcmd
- The metadata for the class represented by this view.public void initialize(org.datanucleus.ClassLoaderResolver clr)
clr
- The ClassLoaderResolverpublic void postInitialize(org.datanucleus.ClassLoaderResolver clr)
postInitialize
in class ViewImpl
clr
- the ClassLoaderResolverpublic JavaTypeMapping getIdMapping()
public DatastoreClass getBaseDatastoreClassWithMember(org.datanucleus.metadata.AbstractMemberMetaData mmd)
getBaseDatastoreClassWithMember
in interface DatastoreClass
mmd
- MetaData for the fieldpublic DatastoreClass getSuperDatastoreClass()
getSuperDatastoreClass
in interface DatastoreClass
public boolean isSuperDatastoreClass(DatastoreClass table)
isSuperDatastoreClass
in interface DatastoreClass
table
- The DatastoreClass to checkpublic Collection getSecondaryDatastoreClasses()
getSecondaryDatastoreClasses
in interface DatastoreClass
public JavaTypeMapping getDatastoreIdMapping()
getDatastoreIdMapping
in interface DatastoreClass
public boolean managesClass(String className)
managesClass
in interface DatastoreClass
className
- Name of the classpublic String[] getManagedClasses()
DatastoreClass
getManagedClasses
in interface DatastoreClass
public boolean managesMapping(JavaTypeMapping mapping)
managesMapping
in interface DatastoreClass
mapping
- The mappingpublic org.datanucleus.metadata.AbstractMemberMetaData getFieldMetaData(String fieldName)
fieldName
- Name of the fieldpublic org.datanucleus.metadata.IdentityType getIdentityType()
getIdentityType
in interface DatastoreClass
public boolean isBaseDatastoreClass()
isBaseDatastoreClass
in interface DatastoreClass
public DatastoreClass getBaseDatastoreClass()
DatastoreClass
getBaseDatastoreClass
in interface DatastoreClass
public boolean isObjectIdDatastoreAttributed()
isObjectIdDatastoreAttributed
in interface DatastoreClass
public void provideDatastoreIdMappings(MappingConsumer consumer)
DatastoreClass
provideDatastoreIdMappings
in interface DatastoreClass
consumer
- Consumer for the mappingspublic void provideDiscriminatorMappings(MappingConsumer consumer)
DatastoreClass
provideDiscriminatorMappings
in interface DatastoreClass
consumer
- Consumer for the mappingspublic void provideMultitenancyMapping(MappingConsumer consumer)
DatastoreClass
provideMultitenancyMapping
in interface DatastoreClass
consumer
- Consumer for the mappingpublic void provideMappingsForMembers(MappingConsumer consumer, org.datanucleus.metadata.AbstractMemberMetaData[] fieldNumbers, boolean includeSecondaryTables)
DatastoreClass
provideMappingsForMembers
in interface DatastoreClass
consumer
- Consumer for the mappingsfieldNumbers
- MetaData of the fields/properties to provide mappings forincludeSecondaryTables
- Whether to supply fields in secondary tablespublic void provideNonPrimaryKeyMappings(MappingConsumer consumer)
DatastoreClass
provideNonPrimaryKeyMappings
in interface DatastoreClass
consumer
- Consumer for the mappingspublic void providePrimaryKeyMappings(MappingConsumer consumer)
DatastoreClass
providePrimaryKeyMappings
in interface DatastoreClass
consumer
- Consumer for the mappingspublic void provideVersionMappings(MappingConsumer consumer)
DatastoreClass
provideVersionMappings
in interface DatastoreClass
consumer
- Consumer for the version mappingspublic void provideExternalMappings(MappingConsumer consumer, int mappingType)
DatastoreClass
provideExternalMappings
in interface DatastoreClass
consumer
- The consumer for the mappingsmappingType
- Type of external mapping to providepublic void provideUnmappedColumns(MappingConsumer consumer)
provideUnmappedColumns
in interface DatastoreClass
consumer
- Consumer of informationpublic String getType()
getType
in interface DatastoreClass
public JavaTypeMapping getMemberMapping(org.datanucleus.metadata.AbstractMemberMetaData mmd)
getMemberMapping
in interface DatastoreClass
mmd
- Metadata for the field/propertypublic JavaTypeMapping getMemberMappingInDatastoreClass(org.datanucleus.metadata.AbstractMemberMetaData mmd)
getMemberMappingInDatastoreClass
in interface DatastoreClass
mmd
- Metadata of the field/propertypublic JavaTypeMapping getMemberMapping(String fieldName)
getMemberMapping
in interface DatastoreClass
fieldName
- Name of the fieldprotected List getSQLCreateStatements(Properties props)
getSQLCreateStatements
in class AbstractTable
props
- Properties for controlling the creation of viewspublic final org.datanucleus.metadata.DiscriminatorMetaData getDiscriminatorMetaData()
getDiscriminatorMetaData
in class AbstractTable
public JavaTypeMapping getDiscriminatorMapping(boolean allowSuperclasses)
getDiscriminatorMapping
in class AbstractTable
allowSuperclasses
- Whether we should return just the mapping from this table
or whether we should return it when this table has none and the supertable haspublic final org.datanucleus.metadata.VersionMetaData getVersionMetaData()
getVersionMetaData
in class AbstractTable
public JavaTypeMapping getVersionMapping(boolean allowSuperclasses)
getVersionMapping
in class AbstractTable
allowSuperclasses
- Whether we should return just the mapping from this table
or whether we should return it when this table has none and the supertable haspublic JavaTypeMapping getExternalMapping(org.datanucleus.metadata.AbstractMemberMetaData fmd, int mappingType)
DatastoreClass
getExternalMapping
in interface DatastoreClass
fmd
- MetaData for the (external) field/propertymappingType
- The type of mappingpublic org.datanucleus.metadata.AbstractMemberMetaData getMetaDataForExternalMapping(JavaTypeMapping mapping, int mappingType)
DatastoreClass
getMetaDataForExternalMapping
in interface DatastoreClass
mapping
- The external mappingmappingType
- The type of mappingCopyright © 2015. All rights reserved.