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

Class JaxMeJdbcSG

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 String
JAXME_JDBC_SCHEMA_URI
Namespace URI of the JDBC schema writer.

Constructor Summary

JaxMeJdbcSG(SGFactoryChain o)
Creates a new instance.

Method Summary

protected 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, Connection pConn)
protected int
getDbType(JaxMeJdbcSG.Mode pDbMode, int pDbType, long pScale, long pPrecision, String pDbTypeName)
Guess an SQL type, based on reported type, scale and precision.
Generator
getGenerator(SGFactory pFactory)
String
getKey()
Returns the key, under which the JaxMeJdbcSG is registered in the factory.
protected SGFactory
getSGFactory()
void
init(SGFactory pFactory)
Object
newSchemaSG(SGFactory pController, XSSchema pSchema)
Object
newTypeSG(SGFactory pController, XSType pType)
Object
newTypeSG(SGFactory pController, XSType pType, Context pClassContext, XsQName pName)
Object
newTypeSG(SGFactory pController, XSType pType, XsQName pName)

Methods inherited from class org.apache.ws.jaxme.generator.sg.impl.SGFactoryChainImpl

getGenerator, getGroupSG, getGroupSG, getGroups, getObjectSG, getObjectSG, getObjectSG, getObjects, getSchemaSG, getSchemaSG, getTypeSG, getTypeSG, getTypeSG, getTypes, init, newFacet, newGroupSG, newGroupSG, newObjectSG, newObjectSG, newObjectSG, newSchemaSG, newTypeSG, newTypeSG, newTypeSG, newXSObjectFactory, newXSParser, newXsObjectFactory

Field Details

JAXME_JDBC_SCHEMA_URI

public static final String JAXME_JDBC_SCHEMA_URI
Namespace URI of the JDBC schema writer.

Constructor Details

JaxMeJdbcSG

public JaxMeJdbcSG(SGFactoryChain o)
Creates a new instance.

Method Details

addColumn

protected Object addColumn(ComplexTypeSG pTypeSG,
                           XSType pType,
                           Column pColumn)
            throws SAXException
Creates a new attribute or chooses an existing atomic child element. Returns the AttributeSG or ParticleSG.

addTableData

protected CustomTableData addTableData(ComplexTypeSG pTypeSG,
                                       XSType pType,
                                       TableDetails pTableDetails)
            throws SAXException

getDatabaseMode

protected JaxMeJdbcSG.Mode getDatabaseMode(ConnectionDetails pDetails,
                                           Connection pConn)
            throws SQLException

getDbType

protected int getDbType(JaxMeJdbcSG.Mode pDbMode,
                        int pDbType,
                        long pScale,
                        long pPrecision,
                        String pDbTypeName)
Guess an SQL type, based on reported type, scale and precision.

getGenerator

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

getKey

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

getSGFactory

protected SGFactory getSGFactory()

init

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

newSchemaSG

public Object newSchemaSG(SGFactory pController,
                          XSSchema pSchema)
            throws SAXException
Specified by:
newSchemaSG in interface SGFactoryChain
Overrides:
newSchemaSG in interface SGFactoryChainImpl

newTypeSG

public Object newTypeSG(SGFactory pController,
                        XSType pType)
            throws SAXException
Specified by:
newTypeSG in interface SGFactoryChain
Overrides:
newTypeSG in interface SGFactoryChainImpl

newTypeSG

public Object newTypeSG(SGFactory pController,
                        XSType pType,
                        Context pClassContext,
                        XsQName pName)
            throws SAXException
Specified by:
newTypeSG in interface SGFactoryChain
Overrides:
newTypeSG in interface SGFactoryChainImpl

newTypeSG

public Object newTypeSG(SGFactory pController,
                        XSType pType,
                        XsQName pName)
            throws SAXException
Specified by:
newTypeSG in interface SGFactoryChain
Overrides:
newTypeSG in interface SGFactoryChainImpl