Interface DatastoreClass
-
- All Superinterfaces:
Table
,org.datanucleus.store.schema.table.Table
- All Known Subinterfaces:
SecondaryDatastoreClass
- All Known Implementing Classes:
ClassTable
,ClassView
,SecondaryTable
public interface DatastoreClass extends Table
Representation of a Java class in a datastore.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DatastoreClass
getBaseDatastoreClass()
Accessor for the base datastore class.DatastoreClass
getBaseDatastoreClassWithMember(org.datanucleus.metadata.AbstractMemberMetaData mmd)
Method to return the base DatastoreClass that persists the specified member.JavaTypeMapping
getExternalMapping(org.datanucleus.metadata.AbstractMemberMetaData mmd, MappingType mappingType)
Accessor for the external mapping for the specified member of the specified mapping type.org.datanucleus.metadata.IdentityType
getIdentityType()
Accessor for the identity-type used by this table.String[]
getManagedClasses()
Accessor for the names of all classes managed by this table.JavaTypeMapping
getMemberMapping(String memberName)
Accessor for the mapping for the specified member name.JavaTypeMapping
getMemberMapping(org.datanucleus.metadata.AbstractMemberMetaData mmd)
Accessor for the mapping for the specified member.JavaTypeMapping
getMemberMappingInDatastoreClass(org.datanucleus.metadata.AbstractMemberMetaData mmd)
Accessor for the mapping for the specified member only in this datastore class.org.datanucleus.metadata.AbstractMemberMetaData
getMetaDataForExternalMapping(JavaTypeMapping mapping, MappingType mappingType)
Accessor for the owner member metadata for the specified external mapping of the specified typeCollection<SecondaryDatastoreClass>
getSecondaryDatastoreClasses()
Accessor for any secondary tables for this table.DatastoreClass
getSuperDatastoreClass()
Accessor for the supertable for this table.String
getType()
Accessor for the primary class represented.boolean
isBaseDatastoreClass()
Accessor for whether this datastore class is the base datastore class for this inheritance hierarchy.boolean
isObjectIdDatastoreAttributed()
Accessor for whether the object id will be attributed by the datastore directly, or whether values have to be supplied.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 classboolean
managesMapping(JavaTypeMapping mapping)
Convenience method to return if this table manages the columns for the supplied mapping.void
provideExternalMappings(MappingConsumer consumer, MappingType mappingType)
Instruction to provide all external mappings to the passed consumer.void
provideMappingsForMembers(MappingConsumer consumer, org.datanucleus.metadata.AbstractMemberMetaData[] mmds, boolean includeSecondaryTables)
Provide the mappings to the consumer for all specified members.void
provideNonPrimaryKeyMappings(MappingConsumer consumer)
Provide the mappings to the consumer for all non primary-key member mapped to this table.void
providePrimaryKeyMappings(MappingConsumer consumer)
Provide the mappings to the consumer for all primary-key member mapped to this table (for application identity).void
provideSurrogateMapping(org.datanucleus.store.schema.table.SurrogateColumnType colType, MappingConsumer consumer)
Provide the mapping for the specified surrogate column (if present).void
provideUnmappedColumns(MappingConsumer consumer)
Instruction to provide all columns without members in the class.String
toString()
Accessor for the name of the datastore class (table).-
Methods inherited from interface org.datanucleus.store.rdbms.table.Table
addColumn, create, drop, exists, getColumn, getDiscriminatorMetaData, getIdentifier, getIdMapping, getStoreManager, getSurrogateMapping, getVersionMetaData, hasColumn, initialize, isInitialized, isInitializedModified, isValidated, postInitialize, preInitialize, validate
-
Methods inherited from interface org.datanucleus.store.schema.table.Table
getCatalogName, getClassMetaData, getColumnForName, getColumnForPosition, getColumns, getMemberColumnMappingForEmbeddedMember, getMemberColumnMappingForMember, getMemberColumnMappings, getName, getNumberOfColumns, getSchemaName, getSurrogateColumn
-
-
-
-
Method Detail
-
getType
String getType()
Accessor for the primary class represented.- Returns:
- Name of the class
-
getIdentityType
org.datanucleus.metadata.IdentityType getIdentityType()
Accessor for the identity-type used by this table.- Returns:
- identity-type tag value
-
isObjectIdDatastoreAttributed
boolean isObjectIdDatastoreAttributed()
Accessor for whether the object id will be attributed by the datastore directly, or whether values have to be supplied.- Returns:
- Whether it is attributed in the datastore
-
isBaseDatastoreClass
boolean isBaseDatastoreClass()
Accessor for whether this datastore class is the base datastore class for this inheritance hierarchy.- Returns:
- Whether it is the base.
-
getBaseDatastoreClass
DatastoreClass getBaseDatastoreClass()
Accessor for the base datastore class. Returns this object if it has no superclass table, otherwise goes up to the superclass etc.- Returns:
- The base datastore class
-
getBaseDatastoreClassWithMember
DatastoreClass getBaseDatastoreClassWithMember(org.datanucleus.metadata.AbstractMemberMetaData mmd)
Method to return the base DatastoreClass that persists the specified member. This navigates up through the superclass tables to find a table that manages the member.- Parameters:
mmd
- MetaData for the member required- Returns:
- The DatastoreClass managing that member
-
isSuperDatastoreClass
boolean isSuperDatastoreClass(DatastoreClass table)
Accessor whether the supplied DatastoreClass is a supertable of this table.- Parameters:
table
- The DatastoreClass to check- Returns:
- Whether it is a supertable (somewhere up the inheritance tree)
-
getSuperDatastoreClass
DatastoreClass getSuperDatastoreClass()
Accessor for the supertable for this table. This is only relevant if the DatastoreClass in use supports supertables. If supertables arent supported by the datastore then null is returned.- Returns:
- The supertable (if any)
-
getSecondaryDatastoreClasses
Collection<SecondaryDatastoreClass> getSecondaryDatastoreClasses()
Accessor for any secondary tables for this table.- Returns:
- Collection of secondary tables (if any)
-
managesClass
boolean managesClass(String className)
Accessor for whether this table manages the specified class- Parameters:
className
- Name of the class- Returns:
- Whether it is managed by this table
-
getManagedClasses
String[] getManagedClasses()
Accessor for the names of all classes managed by this table.- Returns:
- Names of the classes managed (stored) here
-
managesMapping
boolean managesMapping(JavaTypeMapping mapping)
Convenience method to return if this table manages the columns for the supplied mapping.- Parameters:
mapping
- The mapping- Returns:
- Whether the mapping is managed in this table
-
toString
String toString()
Accessor for the name of the datastore class (table).
-
getMemberMapping
JavaTypeMapping getMemberMapping(String memberName)
Accessor for the mapping for the specified member name. Doesn't cope with members of the same name in different subclasses - you should call the equivalent method passing AbstractMemberMetaData for those.- Parameters:
memberName
- Name of member- Returns:
- The Mapping for the member
-
getMemberMapping
JavaTypeMapping getMemberMapping(org.datanucleus.metadata.AbstractMemberMetaData mmd)
Accessor for the mapping for the specified member.- Specified by:
getMemberMapping
in interfaceTable
- Parameters:
mmd
- Metadata of the member- Returns:
- The Mapping for the member.
-
getMemberMappingInDatastoreClass
JavaTypeMapping getMemberMappingInDatastoreClass(org.datanucleus.metadata.AbstractMemberMetaData mmd)
Accessor for the mapping for the specified member only in this datastore class.- Parameters:
mmd
- Metadata of the member- Returns:
- The Mapping for the member (or null if not present here)
-
providePrimaryKeyMappings
void providePrimaryKeyMappings(MappingConsumer consumer)
Provide the mappings to the consumer for all primary-key member mapped to this table (for application identity).- Parameters:
consumer
- Consumer for the mappings
-
provideNonPrimaryKeyMappings
void provideNonPrimaryKeyMappings(MappingConsumer consumer)
Provide the mappings to the consumer for all non primary-key member mapped to this table.- Parameters:
consumer
- Consumer for the mappings
-
provideMappingsForMembers
void provideMappingsForMembers(MappingConsumer consumer, org.datanucleus.metadata.AbstractMemberMetaData[] mmds, boolean includeSecondaryTables)
Provide the mappings to the consumer for all specified members.- Parameters:
consumer
- Consumer for the mappingsmmds
- MetaData of the member to provide mappings forincludeSecondaryTables
- Whether to supply member in secondary tables
-
provideSurrogateMapping
void provideSurrogateMapping(org.datanucleus.store.schema.table.SurrogateColumnType colType, MappingConsumer consumer)
Provide the mapping for the specified surrogate column (if present). This can be datastore id, discriminator, version, multitenancy, soft-delete, etc.- Parameters:
colType
- Type of surrogate columnconsumer
- The consumer for the mapping
-
provideUnmappedColumns
void provideUnmappedColumns(MappingConsumer consumer)
Instruction to provide all columns without members in the class.- Parameters:
consumer
- The consumer for the unmapped columns
-
provideExternalMappings
void provideExternalMappings(MappingConsumer consumer, MappingType mappingType)
Instruction to provide all external mappings to the passed consumer.- Parameters:
consumer
- The consumer for the mappingsmappingType
- Type of external mapping to provide
-
getExternalMapping
JavaTypeMapping getExternalMapping(org.datanucleus.metadata.AbstractMemberMetaData mmd, MappingType mappingType)
Accessor for the external mapping for the specified member of the specified mapping type. An external mapping is a mapping for which there is no member in the actual class to represent it (part of a relation). The type can be FK, FK discriminator, order, etc- Parameters:
mmd
- MetaData for the (external) membermappingType
- The type of mapping- Returns:
- The external mapping
-
getMetaDataForExternalMapping
org.datanucleus.metadata.AbstractMemberMetaData getMetaDataForExternalMapping(JavaTypeMapping mapping, MappingType mappingType)
Accessor for the owner member metadata for the specified external mapping of the specified type- Parameters:
mapping
- The external mappingmappingType
- The type of mapping- Returns:
- Member MetaData in the owner class
-
-