SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool

com.solarmetric.rd.kodo.impl.jdbc.meta
Class SingleFileMappingFactory

java.lang.Object
  |
  +--com.solarmetric.rd.kodo.impl.jdbc.meta.SingleFileMappingFactory
All Implemented Interfaces:
MappingFactory

public class SingleFileMappingFactory
extends java.lang.Object
implements MappingFactory

Factory that use a single XML mapping file to construct the system mappings.


Constructor Summary
SingleFileMappingFactory()
           
 
Method Summary
 boolean dropMappings(com.solarmetric.rd.kodo.meta.ClassMetaData[] types)
          Delete the given mappings.
 com.solarmetric.rd.kodo.impl.jdbc.meta.ClassIndicator[] getAvailableClassIndicators()
          Return a list of all available class indicators, ordered from most to least general.
 com.solarmetric.rd.kodo.impl.jdbc.meta.ClassMapping[] getAvailableClassMappings()
          Return a list of all available class mappings, ordered from most to least general.
 com.solarmetric.rd.kodo.impl.jdbc.meta.FieldMapping[] getAvailableFieldMappings()
          Return a list of all available field mappings, ordered from least to most general.
 com.solarmetric.rd.kodo.impl.jdbc.meta.VersionIndicator[] getAvailableVersionIndicators()
          Return a list of all available version indicators, ordered from most to least general.
 java.lang.String getMappingsResource()
          Return the XML resource defning the mappings.
 boolean isSingleOperation()
          Return true if this factory reads and writes all system mappings at once.
 void readMapping(com.solarmetric.rd.kodo.meta.ClassMetaData type, com.solarmetric.rd.kodo.impl.jdbc.meta.MappingInfoRepository repos)
          Read the object-relational mapping for the given persistent type and add it to the given repository.
 boolean revertMappings(com.solarmetric.rd.kodo.meta.ClassMetaData[] types)
          Revert the mappings to their last saved state, or return false if any cannot be reverted.
 void setConfiguration(com.solarmetric.rd.kodo.impl.jdbc.conf.JDBCConfiguration conf)
          Set the configuration for the factory.
 void setMappingsResource(java.lang.String rsrc)
          Set the XML resource defning the mappings.
 void storeMappings(com.solarmetric.rd.kodo.impl.jdbc.meta.MappingInfoRepository mappings, com.solarmetric.rd.kodo.meta.JDOMetaDataRepository repos)
          Store any changes made to the given mappings, including their field mappings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleFileMappingFactory

public SingleFileMappingFactory()
Method Detail

getMappingsResource

public java.lang.String getMappingsResource()
Return the XML resource defning the mappings. Defaults to kodo.mapping.


setMappingsResource

public void setMappingsResource(java.lang.String rsrc)
Set the XML resource defning the mappings. Defaults to kodo.mapping.


setConfiguration

public void setConfiguration(com.solarmetric.rd.kodo.impl.jdbc.conf.JDBCConfiguration conf)
Description copied from interface: MappingFactory
Set the configuration for the factory.

Specified by:
setConfiguration in interface MappingFactory

isSingleOperation

public boolean isSingleOperation()
Description copied from interface: MappingFactory
Return true if this factory reads and writes all system mappings at once. Knowing this lets us optimize some operations. If a factory returns true to this method, then it should be able to handle MappingFactory.readMapping(com.solarmetric.rd.kodo.meta.ClassMetaData, com.solarmetric.rd.kodo.impl.jdbc.meta.MappingInfoRepository) and MappingFactory.revertMappings(com.solarmetric.rd.kodo.meta.ClassMetaData[]) calls that pass in a null meta data argument.

Specified by:
isSingleOperation in interface MappingFactory

readMapping

public void readMapping(com.solarmetric.rd.kodo.meta.ClassMetaData type,
                        com.solarmetric.rd.kodo.impl.jdbc.meta.MappingInfoRepository repos)
Description copied from interface: MappingFactory
Read the object-relational mapping for the given persistent type and add it to the given repository.

Specified by:
readMapping in interface MappingFactory
Parameters:
type - the type to read mapping information for
repos - add the mapping information to this repository

storeMappings

public void storeMappings(com.solarmetric.rd.kodo.impl.jdbc.meta.MappingInfoRepository mappings,
                          com.solarmetric.rd.kodo.meta.JDOMetaDataRepository repos)
Description copied from interface: MappingFactory
Store any changes made to the given mappings, including their field mappings.

Specified by:
storeMappings in interface MappingFactory
Parameters:
mappings - the changed mappings
repos - can be used to access class metadata if needed

revertMappings

public boolean revertMappings(com.solarmetric.rd.kodo.meta.ClassMetaData[] types)
Description copied from interface: MappingFactory
Revert the mappings to their last saved state, or return false if any cannot be reverted.

Specified by:
revertMappings in interface MappingFactory
Parameters:
types - the types to revert
Returns:
true if all mappings were reverted, false otherwise

dropMappings

public boolean dropMappings(com.solarmetric.rd.kodo.meta.ClassMetaData[] types)
Description copied from interface: MappingFactory
Delete the given mappings.

Specified by:
dropMappings in interface MappingFactory
Parameters:
types - the types to drop
Returns:
true if all mappings were dropped, false otherwise

getAvailableClassMappings

public com.solarmetric.rd.kodo.impl.jdbc.meta.ClassMapping[] getAvailableClassMappings()
Description copied from interface: MappingFactory
Return a list of all available class mappings, ordered from most to least general.

Specified by:
getAvailableClassMappings in interface MappingFactory

getAvailableFieldMappings

public com.solarmetric.rd.kodo.impl.jdbc.meta.FieldMapping[] getAvailableFieldMappings()
Description copied from interface: MappingFactory
Return a list of all available field mappings, ordered from least to most general. When creating a default mapping for a new field, we call the Mapping.map() method on a new instance of each returned mapping util one returns true, or until the list is exhausted. Implementations are free to use or add to the standard mappings list available from FieldMapping.getDefaults().

Specified by:
getAvailableFieldMappings in interface MappingFactory

getAvailableVersionIndicators

public com.solarmetric.rd.kodo.impl.jdbc.meta.VersionIndicator[] getAvailableVersionIndicators()
Description copied from interface: MappingFactory
Return a list of all available version indicators, ordered from most to least general.

Specified by:
getAvailableVersionIndicators in interface MappingFactory

getAvailableClassIndicators

public com.solarmetric.rd.kodo.impl.jdbc.meta.ClassIndicator[] getAvailableClassIndicators()
Description copied from interface: MappingFactory
Return a list of all available class indicators, ordered from most to least general.

Specified by:
getAvailableClassIndicators in interface MappingFactory

SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool

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