|
SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.solarmetric.rd.kodo.impl.jdbc.meta.Mapping
Base class for all mappings.
| Field Summary | |
static int |
DEFAULT
|
static int |
FALSE
|
static int |
LOB
|
static int |
TRUE
|
static int |
UNIQUE
|
| Constructor Summary | |
Mapping()
|
|
| Method Summary | |
protected void |
checkIndex(java.lang.String name,
int index,
com.solarmetric.rd.kodo.impl.jdbc.schema.Column[] idxCols,
int defaultIndexed)
Check the index-related extensions on the given meta data, and make sure they are consistent with the schema. |
protected com.solarmetric.rd.kodo.impl.jdbc.schema.Column |
createColumn(java.lang.String name,
int jdbcType,
int size,
com.solarmetric.rd.kodo.impl.jdbc.schema.Table table)
Create a new column for the given metadata. |
void |
delete(com.solarmetric.rd.kodo.runtime.StateManagerImpl sm,
com.solarmetric.rd.kodo.impl.jdbc.runtime.JDBCStoreManager store,
java.sql.Connection conn)
Override this method to customize flushing this mapping. |
abstract void |
delete(com.solarmetric.rd.kodo.runtime.StateManagerImpl sm,
com.solarmetric.rd.kodo.impl.jdbc.runtime.RowManager rm)
Set the where values appropriately to delete the proper instance, and set all relations on non-secondary tables as updates. |
abstract 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 com.solarmetric.rd.kodo.impl.jdbc.schema.DBDictionary |
getDBDictionary()
Return the dictionary to use. |
protected com.solarmetric.rd.kodo.impl.jdbc.schema.ForeignKey |
getForeignKey(com.solarmetric.rd.kodo.impl.jdbc.meta.MappingInfo info,
java.lang.String attrSuffix,
com.solarmetric.rd.kodo.impl.jdbc.schema.Table table,
com.solarmetric.rd.kodo.impl.jdbc.schema.Table toTable)
Return a foreign key between the given tables, based on linking information in the given mapping info. |
protected org.apache.commons.logging.Log |
getLog()
Return the log to write to. |
abstract com.solarmetric.rd.kodo.impl.jdbc.meta.MappingRepository |
getMappingRepository()
Return the repository for this mapping. |
java.lang.String |
getMappingType()
Return the abbreviated name of this mapping, or the full class name if it is a custom mapping. |
protected com.solarmetric.rd.kodo.impl.jdbc.schema.SchemaGroup |
getSchemaGroup()
Return the system schema. |
abstract com.solarmetric.rd.kodo.impl.jdbc.schema.Table |
getTable()
Return the mapping's data table. |
void |
insert(com.solarmetric.rd.kodo.runtime.StateManagerImpl sm,
com.solarmetric.rd.kodo.impl.jdbc.runtime.JDBCStoreManager store,
java.sql.Connection conn)
Override this method to customize flushing this mapping. |
abstract 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. |
protected boolean |
invalidMapping(java.lang.String msg)
Log a warning about bad mapping info and return false. |
java.lang.Boolean |
isCustomDelete(com.solarmetric.rd.kodo.runtime.StateManagerImpl sm)
Return Boolean.FALSE if this mapping does not customize the
delete process, Boolean.TRUE if it does, or null if it does
customize the delete, but also relies on the standard delete method
being called. |
java.lang.Boolean |
isCustomInsert(com.solarmetric.rd.kodo.runtime.StateManagerImpl sm)
Return Boolean.FALSE if this mapping does not customize the
insert process, Boolean.TRUE if it does, or null if it does
customize the insert, but also relies on the standard insert method
being called. |
java.lang.Boolean |
isCustomUpdate(com.solarmetric.rd.kodo.runtime.StateManagerImpl sm)
Return Boolean.FALSE if this mapping does not customize the
update process, Boolean.TRUE if it does, or null if it does
customize the update, but also relies on the standard update method
being called. |
abstract boolean |
map()
Map a new instance of this mapping type. |
abstract void |
refSchemaComponents()
Increment the reference count of all used schema components. |
void |
reverseMap(com.solarmetric.rd.kodo.impl.jdbc.schema.SchemaGroup schema,
com.solarmetric.rd.kodo.impl.jdbc.meta.ReverseMappingTool tool)
Create mappings from the schema, using the given tool. |
protected void |
setForeignKey(com.solarmetric.rd.kodo.impl.jdbc.meta.MappingInfo info,
java.lang.String attrSuffix,
com.solarmetric.rd.kodo.impl.jdbc.schema.ForeignKey fk)
Sets the attributes for linking with the given foreign key into the given mapping info. |
abstract 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. |
void |
update(com.solarmetric.rd.kodo.runtime.StateManagerImpl sm,
com.solarmetric.rd.kodo.impl.jdbc.runtime.JDBCStoreManager store,
java.sql.Connection conn)
Override this method to customize flushing this mapping. |
abstract void |
update(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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int DEFAULT
public static final int TRUE
public static final int FALSE
public static final int UNIQUE
public static final int LOB
| Constructor Detail |
public Mapping()
| Method Detail |
public java.lang.String getMappingType()
public abstract void toMappingInfo(com.solarmetric.rd.kodo.impl.jdbc.meta.MappingInfo info)
MappingInfo instance
for transfer to XML or some other format.
public abstract boolean fromMappingInfo(com.solarmetric.rd.kodo.impl.jdbc.meta.MappingInfo info,
boolean adapt)
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.
public abstract boolean map()
public void reverseMap(com.solarmetric.rd.kodo.impl.jdbc.schema.SchemaGroup schema,
com.solarmetric.rd.kodo.impl.jdbc.meta.ReverseMappingTool tool)
public abstract com.solarmetric.rd.kodo.impl.jdbc.schema.Table getTable()
public abstract void refSchemaComponents()
public abstract void insert(com.solarmetric.rd.kodo.runtime.StateManagerImpl sm,
com.solarmetric.rd.kodo.impl.jdbc.runtime.RowManager rm)
throws java.sql.SQLException
java.sql.SQLException
public abstract void update(com.solarmetric.rd.kodo.runtime.StateManagerImpl sm,
com.solarmetric.rd.kodo.impl.jdbc.runtime.RowManager rm)
throws java.sql.SQLException
java.sql.SQLExceptioninsert(com.solarmetric.rd.kodo.runtime.StateManagerImpl, com.solarmetric.rd.kodo.impl.jdbc.runtime.RowManager)
public abstract void delete(com.solarmetric.rd.kodo.runtime.StateManagerImpl sm,
com.solarmetric.rd.kodo.impl.jdbc.runtime.RowManager rm)
throws java.sql.SQLException
java.sql.SQLExceptioninsert(com.solarmetric.rd.kodo.runtime.StateManagerImpl, com.solarmetric.rd.kodo.impl.jdbc.runtime.RowManager)public java.lang.Boolean isCustomInsert(com.solarmetric.rd.kodo.runtime.StateManagerImpl sm)
Boolean.FALSE if this mapping does not customize the
insert process, Boolean.TRUE if it does, or null if it does
customize the insert, but also relies on the standard insert method
being called. Implement the
insert(StateManagerImpl,JDBCStoreManager,Connection) method
to implement the custom insertion behavior.
public java.lang.Boolean isCustomUpdate(com.solarmetric.rd.kodo.runtime.StateManagerImpl sm)
Boolean.FALSE if this mapping does not customize the
update process, Boolean.TRUE if it does, or null if it does
customize the update, but also relies on the standard update method
being called. Implement the
update(StateManagerImpl,JDBCStoreManager,Connection) method
to override the default update behavior.
public java.lang.Boolean isCustomDelete(com.solarmetric.rd.kodo.runtime.StateManagerImpl sm)
Boolean.FALSE if this mapping does not customize the
delete process, Boolean.TRUE if it does, or null if it does
customize the delete, but also relies on the standard delete method
being called. Implement the
delete(StateManagerImpl,JDBCStoreManager,Connection) method
to override the default deletion behavior.
public void insert(com.solarmetric.rd.kodo.runtime.StateManagerImpl sm,
com.solarmetric.rd.kodo.impl.jdbc.runtime.JDBCStoreManager store,
java.sql.Connection conn)
throws java.sql.SQLException
java.sql.SQLException
public void update(com.solarmetric.rd.kodo.runtime.StateManagerImpl sm,
com.solarmetric.rd.kodo.impl.jdbc.runtime.JDBCStoreManager store,
java.sql.Connection conn)
throws java.sql.SQLException
java.sql.SQLException
public void delete(com.solarmetric.rd.kodo.runtime.StateManagerImpl sm,
com.solarmetric.rd.kodo.impl.jdbc.runtime.JDBCStoreManager store,
java.sql.Connection conn)
throws java.sql.SQLException
java.sql.SQLExceptionpublic abstract com.solarmetric.rd.kodo.impl.jdbc.meta.MappingRepository getMappingRepository()
protected com.solarmetric.rd.kodo.impl.jdbc.schema.DBDictionary getDBDictionary()
protected org.apache.commons.logging.Log getLog()
protected com.solarmetric.rd.kodo.impl.jdbc.schema.SchemaGroup getSchemaGroup()
protected boolean invalidMapping(java.lang.String msg)
msg - the localizer key for the message; the 'this' ptr
will be passed as a parameter to the message
protected com.solarmetric.rd.kodo.impl.jdbc.schema.Column createColumn(java.lang.String name,
int jdbcType,
int size,
com.solarmetric.rd.kodo.impl.jdbc.schema.Table table)
protected com.solarmetric.rd.kodo.impl.jdbc.schema.ForeignKey getForeignKey(com.solarmetric.rd.kodo.impl.jdbc.meta.MappingInfo info,
java.lang.String attrSuffix,
com.solarmetric.rd.kodo.impl.jdbc.schema.Table table,
com.solarmetric.rd.kodo.impl.jdbc.schema.Table toTable)
protected void setForeignKey(com.solarmetric.rd.kodo.impl.jdbc.meta.MappingInfo info,
java.lang.String attrSuffix,
com.solarmetric.rd.kodo.impl.jdbc.schema.ForeignKey fk)
protected void checkIndex(java.lang.String name,
int index,
com.solarmetric.rd.kodo.impl.jdbc.schema.Column[] idxCols,
int defaultIndexed)
defaultIndexed is TRUE or UNIQUE and it
does not already exist. Mappings should use this method with the
appropriate defaultIndexed setting when installing
themselves, and with a defaultIndexed setting of
DEFAULT when reading themselves from mapping info. This
ensures that mappings are created with the appropriate indexing, and
that indexes are created afterwords whenever a user changes the
mapping information to explicitly mark a field indexed, but that
indexes are not added to existing schemas that don't
want them.
|
SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||