Class CompleteClassTable
- java.lang.Object
-
- org.datanucleus.store.schema.table.CompleteClassTable
-
- All Implemented Interfaces:
Table
public class CompleteClassTable extends Object implements Table
Representation of a table for a class where the class is stored in "complete-table" inheritance (or in JPA "TablePerClass") whereby all members (in this class and superclasses) are handled in this table. Also assumes that any persistable fields and collection/map fields are stored in this table (i.e not usable where you have foreign keys in the datastore). Allows for each member to have potentially multiple columns (using MemberColumnMapping). Each column generated will have its position set (origin = 0) and respects "ColumnMetaData.position".
-
-
Constructor Summary
Constructors Constructor Description CompleteClassTable(StoreManager storeMgr, AbstractClassMetaData cmd, SchemaVerifier verifier)
-
Method Summary
-
-
-
Constructor Detail
-
CompleteClassTable
public CompleteClassTable(StoreManager storeMgr, AbstractClassMetaData cmd, SchemaVerifier verifier)
-
-
Method Detail
-
getTypeConverterForMember
protected TypeConverter getTypeConverterForMember(AbstractMemberMetaData mmd, ColumnMetaData[] colmds, TypeManager typeMgr)
-
processEmbeddedMember
protected void processEmbeddedMember(List<AbstractMemberMetaData> mmds, AbstractClassMetaData embCmd, ClassLoaderResolver clr, EmbeddedMetaData embmd, boolean ownerNested)
Handler for an embedded member.- Parameters:
mmds
- Chain of member metadata to the embedded memberembCmd
- Class metadata for the embedded member typeclr
- ClassLoader resolverembmd
- Any EmbeddedMetaData defining column infoownerNested
- Whether the owner is nested
-
addColumn
protected ColumnImpl addColumn(AbstractMemberMetaData mmd, String colName)
-
addColumn
protected ColumnImpl addColumn(AbstractMemberMetaData mmd, String colName, ColumnType colType)
-
addEmbeddedColumn
protected ColumnImpl addEmbeddedColumn(String colName, TypeConverter typeConv)
-
getClassMetaData
public AbstractClassMetaData getClassMetaData()
Description copied from interface:Table
Accessor for the primary class metadata for this table.- Specified by:
getClassMetaData
in interfaceTable
- Returns:
- Class metadata
-
getStoreManager
public StoreManager getStoreManager()
- Specified by:
getStoreManager
in interfaceTable
-
getSchemaName
public String getSchemaName()
- Specified by:
getSchemaName
in interfaceTable
-
getCatalogName
public String getCatalogName()
- Specified by:
getCatalogName
in interfaceTable
-
getNumberOfColumns
public int getNumberOfColumns()
Description copied from interface:Table
Accessor for number of columns.- Specified by:
getNumberOfColumns
in interfaceTable
- Returns:
- Number of cols
-
getColumns
public List<Column> getColumns()
- Specified by:
getColumns
in interfaceTable
-
getColumnForPosition
public Column getColumnForPosition(int pos)
Description copied from interface:Table
Accessor for the column at the specified position (numbered from 0 to numcols-1).- Specified by:
getColumnForPosition
in interfaceTable
- Parameters:
pos
- Position of the column- Returns:
- The column at this position (or null if invalid position)
-
getSurrogateColumn
public Column getSurrogateColumn(SurrogateColumnType colType)
Description copied from interface:Table
Accessor for the surrogate column of the specified type.- Specified by:
getSurrogateColumn
in interfaceTable
- Parameters:
colType
- The type of surrogate column- Returns:
- The column definition, if it exists for this table
-
getColumnForName
public Column getColumnForName(String name)
Description copied from interface:Table
Accessor for the column with the supplied name (if present).- Specified by:
getColumnForName
in interfaceTable
- Parameters:
name
- name of the column (the identifier)- Returns:
- The column (or null if none present with that name)
-
getMemberColumnMappingForMember
public MemberColumnMapping getMemberColumnMappingForMember(AbstractMemberMetaData mmd)
Description copied from interface:Table
Method to return the member-column mapping for the specified member.- Specified by:
getMemberColumnMappingForMember
in interfaceTable
- Parameters:
mmd
- Metadata for the member- Returns:
- The member-column mapping
-
getMemberColumnMappingForEmbeddedMember
public MemberColumnMapping getMemberColumnMappingForEmbeddedMember(List<AbstractMemberMetaData> mmds)
Description copied from interface:Table
Method to return the member-column mapping for the specified embedded member.- Specified by:
getMemberColumnMappingForEmbeddedMember
in interfaceTable
- Parameters:
mmds
- Metadata for the member(s) to navigate to the required member- Returns:
- The member-column mapping
-
getMemberColumnMappings
public Set<MemberColumnMapping> getMemberColumnMappings()
- Specified by:
getMemberColumnMappings
in interfaceTable
-
debugString
public String debugString()
-
-