SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool

com.solarmetric.rd.kodo.impl.jdbc.meta.map
Class ColumnClassIndicator

java.lang.Object
  |
  +--com.solarmetric.rd.kodo.impl.jdbc.meta.Mapping
        |
        +--com.solarmetric.rd.kodo.impl.jdbc.meta.Indicator
              |
              +--com.solarmetric.rd.kodo.impl.jdbc.meta.ClassIndicator
                    |
                    +--com.solarmetric.rd.kodo.impl.jdbc.meta.map.ColumnClassIndicator
Direct Known Subclasses:
InClassNameIndicator, NotInClassNameIndicator

public abstract class ColumnClassIndicator
extends ClassIndicator

Abstract base class for class indicators that use a column to hold class information.


Field Summary
 
Fields inherited from class com.solarmetric.rd.kodo.impl.jdbc.meta.Mapping
DEFAULT, FALSE, LOB, TRUE, UNIQUE
 
Constructor Summary
ColumnClassIndicator()
           
 
Method Summary
 boolean fromMappingInfo(com.solarmetric.rd.kodo.impl.jdbc.meta.MappingInfo info, boolean adapt)
          Deserialize this mapping from a simple MappingInfo instance parsed from XML or some other format.
protected abstract  java.lang.Class getClass(java.lang.Object indicator, java.lang.ClassLoader loader)
          Return the class for the given column value.
 java.lang.Class getClass(com.solarmetric.rd.kodo.impl.jdbc.runtime.Result result, java.lang.ClassLoader loader)
          Return the class for the current result row.
protected abstract  java.lang.Object getClassIndicator(com.solarmetric.rd.kodo.runtime.StateManagerImpl sm)
          Return the value the column should take.
 com.solarmetric.rd.kodo.impl.jdbc.schema.Column getColumn()
          Return the column used to hold class info.
protected abstract  int getDataStoreTypeCode()
          Return the FieldMapping type code for the type of data stored by this indicator.
protected  int getJDBCType()
          Return the JDBC type of the column for this indicator.
 void insert(com.solarmetric.rd.kodo.runtime.StateManagerImpl sm, com.solarmetric.rd.kodo.impl.jdbc.runtime.RowManager rm)
          Set values for the mapping into the proper rows.
 boolean map()
          Map a new instance of this mapping type.
 void refSchemaComponents()
          Increment the reference count of all used schema components.
 void select(com.solarmetric.rd.kodo.impl.jdbc.runtime.Select sel)
          Select the virtual row columns of this mapping.
 void setColumn(com.solarmetric.rd.kodo.impl.jdbc.schema.Column col)
          Set the column used to hold class info.
 void toMappingInfo(com.solarmetric.rd.kodo.impl.jdbc.meta.MappingInfo info)
          Serialize this mapping to a simple MappingInfo instance for transfer to XML or some other format.
 
Methods inherited from class com.solarmetric.rd.kodo.impl.jdbc.meta.ClassIndicator
addClassConditions, getDefaults, newInstance, newInstance, toString
 
Methods inherited from class com.solarmetric.rd.kodo.impl.jdbc.meta.Indicator
delete, getMappingRepository, getOwnerMapping, getTable, setOwnerMapping, update
 
Methods inherited from class com.solarmetric.rd.kodo.impl.jdbc.meta.Mapping
checkIndex, createColumn, delete, getDBDictionary, getForeignKey, getLog, getMappingType, getSchemaGroup, insert, invalidMapping, isCustomDelete, isCustomInsert, isCustomUpdate, reverseMap, setForeignKey, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ColumnClassIndicator

public ColumnClassIndicator()
Method Detail

getColumn

public com.solarmetric.rd.kodo.impl.jdbc.schema.Column getColumn()
Return the column used to hold class info.


setColumn

public void setColumn(com.solarmetric.rd.kodo.impl.jdbc.schema.Column col)
Set the column used to hold class info.


getDataStoreTypeCode

protected abstract int getDataStoreTypeCode()
Return the FieldMapping type code for the type of data stored by this indicator.


getJDBCType

protected int getJDBCType()
Return the JDBC type of the column for this indicator. Defaults to the preferred type for getDataStoreTypeCode().


getClassIndicator

protected abstract java.lang.Object getClassIndicator(com.solarmetric.rd.kodo.runtime.StateManagerImpl sm)
Return the value the column should take.


getClass

protected abstract java.lang.Class getClass(java.lang.Object indicator,
                                            java.lang.ClassLoader loader)
                                     throws java.lang.ClassNotFoundException
Return the class for the given column value.

java.lang.ClassNotFoundException

toMappingInfo

public void toMappingInfo(com.solarmetric.rd.kodo.impl.jdbc.meta.MappingInfo info)
Description copied from class: Mapping
Serialize this mapping to a simple MappingInfo instance for transfer to XML or some other format.

Specified by:
toMappingInfo in class Mapping

fromMappingInfo

public boolean fromMappingInfo(com.solarmetric.rd.kodo.impl.jdbc.meta.MappingInfo info,
                               boolean adapt)
Description copied from class: Mapping
Deserialize this mapping from a simple MappingInfo instance parsed from XML or some other format. If the info is incompatible and adapt is true, try to adapt to the new info, else return false. This method must validate the given mapping information using the SchemaGroup.findTable(java.lang.String) method to find any needed tables, the Table.getColumn(java.lang.String) method to retrieve columns from those tables, and the Column.isCompatible(int, int) method to check all column types. This is important, as some schema groups use these methods to build themselves up dynamically rather than reading schema information from the database.

Specified by:
fromMappingInfo in class Mapping

map

public boolean map()
Description copied from class: Mapping
Map a new instance of this mapping type. If the underlying metadata cannot be mapped using this type, return false.

Specified by:
map in class Mapping

refSchemaComponents

public void refSchemaComponents()
Description copied from class: Mapping
Increment the reference count of all used schema components.

Overrides:
refSchemaComponents in class Indicator

insert

public void insert(com.solarmetric.rd.kodo.runtime.StateManagerImpl sm,
                   com.solarmetric.rd.kodo.impl.jdbc.runtime.RowManager rm)
            throws java.sql.SQLException
Description copied from class: Mapping
Set values for the mapping into the proper rows. For class mappings, this method will be called only after the corresponding method has been called for all fields of this mapping.

Overrides:
insert in class Indicator
java.sql.SQLException

select

public void select(com.solarmetric.rd.kodo.impl.jdbc.runtime.Select sel)
Description copied from class: Indicator
Select the virtual row columns of this mapping.

Overrides:
select in class Indicator

getClass

public java.lang.Class getClass(com.solarmetric.rd.kodo.impl.jdbc.runtime.Result result,
                                java.lang.ClassLoader loader)
                         throws java.sql.SQLException,
                                java.lang.ClassNotFoundException
Description copied from class: ClassIndicator
Return the class for the current result row.

Specified by:
getClass in class ClassIndicator
java.sql.SQLException
java.lang.ClassNotFoundException

SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool

Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.