org.jpox.store.rdbms.table
Class ColumnCreator

java.lang.Object
  extended by org.jpox.store.rdbms.table.ColumnCreator

public final class ColumnCreator
extends java.lang.Object

Helper class to create columns. Used for generating columns for reference (Object, interface) fields, and for join table fields.

Version:
$Revision: 1.93 $

Field Summary
protected static org.jpox.util.Localiser LOCALISER
          Localiser for messages.
 
Method Summary
static void createColumnsForFieldUsingReference(org.jpox.store.mapped.mapping.JavaTypeMapping mapping, org.jpox.store.mapped.DatastoreContainerObject table, org.jpox.metadata.AbstractMemberMetaData fmd, org.jpox.ClassLoaderResolver clr, boolean embedded)
          Create columns for reference (Object/interface) fields.
static void createColumnsForFieldUsingSubclassTable(org.jpox.store.mapped.mapping.JavaTypeMapping mapping, org.jpox.store.mapped.DatastoreContainerObject table, org.jpox.metadata.AbstractMemberMetaData fmd, org.jpox.ClassLoaderResolver clr)
          Create columns for a field that uses subclass-table inheritance and where we want to have a FK for each subclass with its own table.
static org.jpox.store.mapped.mapping.JavaTypeMapping createColumnsForJoinTables(java.lang.Class javaType, org.jpox.metadata.AbstractMemberMetaData fmd, org.jpox.metadata.ColumnMetaData[] columnMetaData, org.jpox.store.mapped.MappedStoreManager storeMgr, org.jpox.store.mapped.DatastoreContainerObject table, boolean primaryKey, boolean nullable, boolean serialised, boolean embedded, int fieldRole, org.jpox.ClassLoaderResolver clr)
          Method to create the required columns (and mapping if necessary) for a field
static org.jpox.store.mapped.DatastoreField createIndexColumn(org.jpox.store.mapped.mapping.JavaTypeMapping mapping, org.jpox.store.mapped.MappedStoreManager storeMgr, org.jpox.ClassLoaderResolver clr, org.jpox.store.mapped.DatastoreContainerObject table, org.jpox.metadata.ColumnMetaData colmd, boolean pk)
          Convenience method to add the column for an index mapping.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCALISER

protected static final org.jpox.util.Localiser LOCALISER
Localiser for messages.

Method Detail

createIndexColumn

public static org.jpox.store.mapped.DatastoreField createIndexColumn(org.jpox.store.mapped.mapping.JavaTypeMapping mapping,
                                                                     org.jpox.store.mapped.MappedStoreManager storeMgr,
                                                                     org.jpox.ClassLoaderResolver clr,
                                                                     org.jpox.store.mapped.DatastoreContainerObject table,
                                                                     org.jpox.metadata.ColumnMetaData colmd,
                                                                     boolean pk)
Convenience method to add the column for an index mapping.

Parameters:
mapping - The mapping
storeMgr - Manager for the store
clr - ClassLoaderResolver
table - Table where we create the column
colmd - The column MetaData
pk - Whether this column is (part of) the PK.
Returns:
The added column

createColumnsForJoinTables

public static org.jpox.store.mapped.mapping.JavaTypeMapping createColumnsForJoinTables(java.lang.Class javaType,
                                                                                       org.jpox.metadata.AbstractMemberMetaData fmd,
                                                                                       org.jpox.metadata.ColumnMetaData[] columnMetaData,
                                                                                       org.jpox.store.mapped.MappedStoreManager storeMgr,
                                                                                       org.jpox.store.mapped.DatastoreContainerObject table,
                                                                                       boolean primaryKey,
                                                                                       boolean nullable,
                                                                                       boolean serialised,
                                                                                       boolean embedded,
                                                                                       int fieldRole,
                                                                                       org.jpox.ClassLoaderResolver clr)
Method to create the required columns (and mapping if necessary) for a field

Parameters:
javaType - The java type of the field
fmd - Metadata for the field
columnMetaData - MetaData defining the columns
storeMgr - Store Manager
table - The table to add the mapping to
primaryKey - Whether this field is the PK
nullable - Whether this field is to be nullable
serialised - Whether the field is serialised
embedded - Whether the field is embedded
fieldRole - The role of this field (if any)
clr - ClassLoader resolver
Returns:
The java type mapping for this field

createColumnsForFieldUsingSubclassTable

public static void createColumnsForFieldUsingSubclassTable(org.jpox.store.mapped.mapping.JavaTypeMapping mapping,
                                                           org.jpox.store.mapped.DatastoreContainerObject table,
                                                           org.jpox.metadata.AbstractMemberMetaData fmd,
                                                           org.jpox.ClassLoaderResolver clr)
Create columns for a field that uses subclass-table inheritance and where we want to have a FK for each subclass with its own table.

Parameters:
mapping - the mapping for the field
table - the Table which will hold the columns
fmd - MetaData for the field
clr - The ClassLoaderResolver

createColumnsForFieldUsingReference

public static void createColumnsForFieldUsingReference(org.jpox.store.mapped.mapping.JavaTypeMapping mapping,
                                                       org.jpox.store.mapped.DatastoreContainerObject table,
                                                       org.jpox.metadata.AbstractMemberMetaData fmd,
                                                       org.jpox.ClassLoaderResolver clr,
                                                       boolean embedded)
Create columns for reference (Object/interface) fields.

Parameters:
mapping - the mapping for the field
table - the Table which will hold the columns
fmd - MetaData for the field
clr - The ClassLoaderResolver
embedded - Whether the field is embedded


Copyright © -2008 . All Rights Reserved.