org.exolab.castor.jdo.engine

Class SQLEngine

Implemented Interfaces:
Persistence

public final class SQLEngine
extends java.lang.Object
implements Persistence

The SQL engine performs persistence of one object type against one SQL database. It can only persist simple objects and extended relationships. An SQL engine is created for each object type represented by a database. When persisting, it requires a physical connection that maps to the SQL database and the transaction running on that database
Version:
$Revision: 7272 $ $Date: 2006-04-26 16:24:34 -0600 (Wed, 26 Apr 2006) $
Authors:
Assaf Arkin
Thomas Yip
Bruce Snyder
Werner Guttmann
Ralf Joachim

Constructor Summary

SQLEngine(JDOClassDescriptor clsDesc, PersistenceFactory factory, String stampField)

Method Summary

Identity
create(Database database, Object conn, ProposedEntity entity, Identity identity)
PersistenceQuery
createCall(String spCall, Class[] types)
PersistenceQuery
createQuery(QueryExpression query, Class[] types, AccessMode accessMode)
void
delete(Object conn, Identity identity)
SQLColumnInfo[]
getColumnInfoForIdentities()
JDOClassDescriptor
getDescriptor()
Used by OQLQuery to retrieve the class descriptor.
SQLEngine
getExtends()
QueryExpression
getFinder()
SQLFieldInfo[]
getInfo()
QueryExpression
getQueryExpression()
protected Object
idToJava(int index, Object object)
Object
load(Object conn, ProposedEntity entity, Identity identity, AccessMode accessMode)
Loads the object from persistence storage.
void
setExtends(SQLEngine engine)
Mutator method for setting extends SQLEngine.
Object
store(Object conn, Identity identity, ProposedEntity newentity, ProposedEntity oldentity)
protected Object
toJava(int field, int column, Object object)
String
toString()

Constructor Details

SQLEngine

(package private)  SQLEngine(JDOClassDescriptor clsDesc,
                             PersistenceFactory factory,
                             String stampField)
            throws MappingException

Method Details

create

public Identity create(Database database,
                       Object conn,
                       ProposedEntity entity,
                       Identity identity)
            throws PersistenceException
Specified by:
create in interface Persistence

createCall

public PersistenceQuery createCall(String spCall,
                                   Class[] types)

createQuery

public PersistenceQuery createQuery(QueryExpression query,
                                    Class[] types,
                                    AccessMode accessMode)
            throws QueryException
Specified by:
createQuery in interface Persistence

delete

public void delete(Object conn,
                   Identity identity)
            throws PersistenceException
Specified by:
delete in interface Persistence

getColumnInfoForIdentities

public SQLColumnInfo[] getColumnInfoForIdentities()

getDescriptor

public JDOClassDescriptor getDescriptor()
Used by OQLQuery to retrieve the class descriptor.
Returns:
the JDO class descriptor.

getExtends

public SQLEngine getExtends()

getFinder

public QueryExpression getFinder()

getInfo

public SQLFieldInfo[] getInfo()

getQueryExpression

public QueryExpression getQueryExpression()

idToJava

protected Object idToJava(int index,
                          Object object)

load

public Object load(Object conn,
                   ProposedEntity entity,
                   Identity identity,
                   AccessMode accessMode)
            throws PersistenceException
Loads the object from persistence storage. This method will load the object fields from persistence storage based on the object's identity. This method may return a stamp which can be used at a later point to determine whether the copy of the object in persistence storage is newer than the cached copy (see store(Object,Identity,ProposedEntity,ProposedEntity)). If lock is true the object must be locked in persistence storage to prevent concurrent updates.
Specified by:
load in interface Persistence
Parameters:
conn - An open connection
entity - An Object[] to load field values into
identity - Identity of the object to load.
accessMode - The access mode (null equals shared)
Returns:
The object's stamp, or null
Throws:
PersistenceException - A persistence error occured

setExtends

public void setExtends(SQLEngine engine)
Mutator method for setting extends SQLEngine.
Parameters:
engine -

store

public Object store(Object conn,
                    Identity identity,
                    ProposedEntity newentity,
                    ProposedEntity oldentity)
            throws PersistenceException
Specified by:
store in interface Persistence

toJava

protected Object toJava(int field,
                        int column,
                        Object object)

toString

public String toString()

Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com