org.apache.ws.jaxme.pm.generator.jdbc
Class JaxMeJdbcSG

java.lang.Object
  extended by org.apache.ws.jaxme.generator.sg.impl.SGFactoryChainImpl
      extended by org.apache.ws.jaxme.pm.generator.jdbc.JaxMeJdbcSG
All Implemented Interfaces:
SGFactoryChain

public class JaxMeJdbcSG
extends SGFactoryChainImpl

A schema writer for creation of an object relational mapping.

Author:
Jochen Wiedmann

Nested Class Summary
static class JaxMeJdbcSG.Mode
          A database mode specifies, how JDBC metadata is being interpreted.
 
Field Summary
static java.lang.String JAXME_JDBC_SCHEMA_URI
          Namespace URI of the JDBC schema writer.
 
Constructor Summary
JaxMeJdbcSG(SGFactoryChain o)
          Creates a new instance.
 
Method Summary
protected  java.lang.Object addColumn(ComplexTypeSG pTypeSG, XSType pType, Column pColumn)
          Creates a new attribute or chooses an existing atomic child element.
protected  CustomTableData addTableData(ComplexTypeSG pTypeSG, XSType pType, TableDetails pTableDetails)
           
protected  JaxMeJdbcSG.Mode getDatabaseMode(ConnectionDetails pDetails, java.sql.Connection pConn)
           
protected  int getDbType(JaxMeJdbcSG.Mode pDbMode, int pDbType, long pScale, long pPrecision, java.lang.String pDbTypeName)
          Guess an SQL type, based on reported type, scale and precision.
 Generator getGenerator(SGFactory pFactory)
           
 java.lang.String getKey()
          Returns the key, under which the JaxMeJdbcSG is registered in the factory.
protected  SGFactory getSGFactory()
           
 void init(SGFactory pFactory)
           
 java.lang.Object newSchemaSG(SGFactory pController, XSSchema pSchema)
           
 java.lang.Object newTypeSG(SGFactory pController, XSType pType, Context pClassContext, XsQName pName, JAXBProperty.BaseType pBaseType)
           
 java.lang.Object newTypeSG(SGFactory pController, XSType pType, JAXBProperty.BaseType pBaseType)
           
 java.lang.Object newTypeSG(SGFactory pController, XSType pType, XsQName pName, JAXBProperty.BaseType pBaseType)
           
 
Methods inherited from class org.apache.ws.jaxme.generator.sg.impl.SGFactoryChainImpl
getGroups, getGroupSG, getGroupSG, getObjects, getObjectSG, getObjectSG, getObjectSG, getSchemaSG, getSchemaSG, getTypes, getTypeSG, getTypeSG, getTypeSG, newFacet, newGroupSG, newGroupSG, newObjectSG, newObjectSG, newObjectSG, newXsObjectFactory, newXSObjectFactory, newXSParser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JAXME_JDBC_SCHEMA_URI

public static final java.lang.String JAXME_JDBC_SCHEMA_URI

Namespace URI of the JDBC schema writer.

See Also:
Constant Field Values
Constructor Detail

JaxMeJdbcSG

public JaxMeJdbcSG(SGFactoryChain o)
Creates a new instance.

Method Detail

getKey

public java.lang.String getKey()
Returns the key, under which the JaxMeJdbcSG is registered in the factory.


init

public void init(SGFactory pFactory)
Specified by:
init in interface SGFactoryChain
Overrides:
init in class SGFactoryChainImpl

getSGFactory

protected SGFactory getSGFactory()

getGenerator

public Generator getGenerator(SGFactory pFactory)
Specified by:
getGenerator in interface SGFactoryChain
Overrides:
getGenerator in class SGFactoryChainImpl

getDatabaseMode

protected JaxMeJdbcSG.Mode getDatabaseMode(ConnectionDetails pDetails,
                                           java.sql.Connection pConn)
                                    throws java.sql.SQLException
Throws:
java.sql.SQLException

getDbType

protected int getDbType(JaxMeJdbcSG.Mode pDbMode,
                        int pDbType,
                        long pScale,
                        long pPrecision,
                        java.lang.String pDbTypeName)

Guess an SQL type, based on reported type, scale and precision.


addColumn

protected java.lang.Object addColumn(ComplexTypeSG pTypeSG,
                                     XSType pType,
                                     Column pColumn)
                              throws org.xml.sax.SAXException

Creates a new attribute or chooses an existing atomic child element. Returns the AttributeSG or ParticleSG.

Throws:
org.xml.sax.SAXException

addTableData

protected CustomTableData addTableData(ComplexTypeSG pTypeSG,
                                       XSType pType,
                                       TableDetails pTableDetails)
                                throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

newTypeSG

public java.lang.Object newTypeSG(SGFactory pController,
                                  XSType pType,
                                  JAXBProperty.BaseType pBaseType)
                           throws org.xml.sax.SAXException
Specified by:
newTypeSG in interface SGFactoryChain
Overrides:
newTypeSG in class SGFactoryChainImpl
Throws:
org.xml.sax.SAXException

newTypeSG

public java.lang.Object newTypeSG(SGFactory pController,
                                  XSType pType,
                                  XsQName pName,
                                  JAXBProperty.BaseType pBaseType)
                           throws org.xml.sax.SAXException
Specified by:
newTypeSG in interface SGFactoryChain
Overrides:
newTypeSG in class SGFactoryChainImpl
Throws:
org.xml.sax.SAXException

newTypeSG

public java.lang.Object newTypeSG(SGFactory pController,
                                  XSType pType,
                                  Context pClassContext,
                                  XsQName pName,
                                  JAXBProperty.BaseType pBaseType)
                           throws org.xml.sax.SAXException
Specified by:
newTypeSG in interface SGFactoryChain
Overrides:
newTypeSG in class SGFactoryChainImpl
Throws:
org.xml.sax.SAXException

newSchemaSG

public java.lang.Object newSchemaSG(SGFactory pController,
                                    XSSchema pSchema)
                             throws org.xml.sax.SAXException
Specified by:
newSchemaSG in interface SGFactoryChain
Overrides:
newSchemaSG in class SGFactoryChainImpl
Throws:
org.xml.sax.SAXException