SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool

com.solarmetric.rd.kodo.impl.jdbc.schema
Class TrueSequenceFactory

java.lang.Object
  |
  +--com.solarmetric.rd.kodo.impl.jdbc.schema.TrueSequenceFactory
All Implemented Interfaces:
SequenceFactory

public class TrueSequenceFactory
extends java.lang.Object
implements SequenceFactory

SequenceFactory implementation that uses a singular database sequence to generate numbers. Named true as it attempts to use native database id generation.

Note this will NOT work on databases that do not support sequences (e.g. SQLServer).


Constructor Summary
TrueSequenceFactory()
           
 
Method Summary
 java.lang.String getFormat()
          Return the MessageFormat string to use as for SQL generation.
 long getNext(java.lang.Class cls, java.lang.String user, java.lang.String pass)
          Return a unique primary key value.
 java.lang.String getSequenceName()
          Return the name of the sequence used
 java.lang.String getTableName()
          Return the table name to run sequence queries against.
static void main(java.lang.String[] args)
          Usage: java com.solarmetric.kodo.impl.jdbc.schema.TrueSequenceFactory [option]*
 void setConfiguration(com.solarmetric.rd.kodo.impl.jdbc.conf.JDBCConfiguration conf)
          Set the configuration for this factory; allows access to database connection information, etc.
 void setFormat(java.lang.String messageFormat)
          Set the string used for MessageFormat to generate the sequence selecting SQL.
 void setSequenceName(java.lang.String seqName)
          Set the sequence used.
 void setTableName(java.lang.String name)
          Set the table name to run sequence queries against.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrueSequenceFactory

public TrueSequenceFactory()
Method Detail

getTableName

public java.lang.String getTableName()
Return the table name to run sequence queries against.


setTableName

public void setTableName(java.lang.String name)
Set the table name to run sequence queries against. Defaults to DUAL.

Parameters:
name - the name of the table

getFormat

public java.lang.String getFormat()
Return the MessageFormat string to use as for SQL generation.


setFormat

public void setFormat(java.lang.String messageFormat)
Set the string used for MessageFormat to generate the sequence selecting SQL. Should have two placeholders: {0} for the sequence name and {1} for the table name (e.g. dual). Also, it converts $ to spaces to help with auto configuration Defaults to select {0}.NEXTVAL from {1}.


getSequenceName

public java.lang.String getSequenceName()
Return the name of the sequence used


setSequenceName

public void setSequenceName(java.lang.String seqName)
Set the sequence used. Defaults to JDOSEQUENCE.


setConfiguration

public void setConfiguration(com.solarmetric.rd.kodo.impl.jdbc.conf.JDBCConfiguration conf)
Description copied from interface: SequenceFactory
Set the configuration for this factory; allows access to database connection information, etc.

Specified by:
setConfiguration in interface SequenceFactory

getNext

public long getNext(java.lang.Class cls,
                    java.lang.String user,
                    java.lang.String pass)
Description copied from interface: SequenceFactory
Return a unique primary key value.

Specified by:
getNext in interface SequenceFactory
Parameters:
cls - the class of the object being persisted
user - the authentication information for connecting to the database
pass - the authentication information for connecting to the database

main

public static void main(java.lang.String[] args)
                 throws java.sql.SQLException

Usage: java com.solarmetric.kodo.impl.jdbc.schema.TrueSequenceFactory [option]*

Where the following options are recognized.

If the license key is not specified otherwise, Kodo will check for default preference files with license keys as outlined in DefaultConfiguration.

java.sql.SQLException

SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool

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