|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exolab.castor.jdo.engine.SQLEngine
public final class SQLEngine
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
Nested Class Summary | |
---|---|
(package private) static class |
SQLEngine.ColumnInfo
|
(package private) static class |
SQLEngine.FieldInfo
|
(package private) static class |
SQLEngine.SQLQuery
|
Constructor Summary | |
---|---|
SQLEngine(JDOClassDescriptor clsDesc,
PersistenceFactory factory,
java.lang.String stampField)
|
Method Summary | |
---|---|
java.lang.Object |
create(Database database,
java.lang.Object conn,
java.lang.Object[] fields,
java.lang.Object identity)
Creates a new object in persistence storage. |
PersistenceQuery |
createCall(java.lang.String spCall,
java.lang.Class[] types)
|
PersistenceQuery |
createQuery(QueryExpression query,
java.lang.Class[] types,
AccessMode accessMode)
Creates and returns a new query object. |
void |
delete(java.lang.Object conn,
java.lang.Object identity)
Deletes the object from persistent storage, given the object' identity. |
Persistence.ColumnInfo[] |
getColumnInfoForIdentities()
Returns ColumnInfos for identifiers. |
JDOClassDescriptor |
getDescriptor()
Used by OQLQuery to retrieve the class descriptor. |
QueryExpression |
getFinder()
|
Persistence.FieldInfo[] |
getInfo()
Returns FieldInfos for fields (excluding identifiers). |
QueryExpression |
getQueryExpression()
|
java.lang.Object |
load(java.lang.Object conn,
ProposedObject proposedObject,
java.lang.Object identity,
AccessMode accessMode)
Loads the object from persistence storage. |
java.lang.String |
quoteName(java.lang.String name)
Used by ParseTreeWalker to quote names in WHERE clause |
void |
setExtends(SQLEngine engine)
Mutator method for setting extends SQLEngine |
java.lang.Object |
store(java.lang.Object conn,
java.lang.Object[] fields,
java.lang.Object identity,
java.lang.Object[] original,
java.lang.Object stamp)
Stores the object in persistent storage, given the object fields and its identity. |
java.lang.String |
toString()
|
void |
writeLock(java.lang.Object conn,
java.lang.Object identity)
Obtains a write lock on the object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
SQLEngine(JDOClassDescriptor clsDesc, PersistenceFactory factory, java.lang.String stampField) throws MappingException
MappingException
Method Detail |
---|
public Persistence.ColumnInfo[] getColumnInfoForIdentities()
Persistence
getColumnInfoForIdentities
in interface Persistence
public Persistence.FieldInfo[] getInfo()
Persistence
getInfo
in interface Persistence
public void setExtends(SQLEngine engine)
engine
- public JDOClassDescriptor getDescriptor()
OQLQuery
to retrieve the class descriptor.
public java.lang.String quoteName(java.lang.String name)
name
- A name to be quoted
public PersistenceQuery createQuery(QueryExpression query, java.lang.Class[] types, AccessMode accessMode) throws QueryException
Persistence
createQuery
in interface Persistence
query
- The query expressiontypes
- List of all parameter types, or null
QueryException
- The query is invalidpublic PersistenceQuery createCall(java.lang.String spCall, java.lang.Class[] types)
public QueryExpression getQueryExpression()
public QueryExpression getFinder()
public java.lang.Object create(Database database, java.lang.Object conn, java.lang.Object[] fields, java.lang.Object identity) throws DuplicateIdentityException, PersistenceException
Persistence
create
in interface Persistence
conn
- An open connectionfields
- The fields to storeidentity
- The object's identity
DuplicateIdentityException
- An object with the same
identity already exists in persistent storage
PersistenceException
- A persistence error occuredpublic java.lang.Object store(java.lang.Object conn, java.lang.Object[] fields, java.lang.Object identity, java.lang.Object[] original, java.lang.Object stamp) throws ObjectModifiedException, ObjectDeletedException, PersistenceException
Persistence
Persistence.create(org.exolab.castor.jdo.Database, java.lang.Object, java.lang.Object[], java.lang.Object)
. This method should
detect whether the object has been modified in persistent storage
since it was loaded. After this method returns all locks on the
object must be retained until the transaction has completed.
This method may return a new stamp to track further updates to
the object.
If the object was not retrieved for exclusive access, this
method will be asked to perform dirty checking prior to storing
the object. The original argument will contains the
object's original fields as retrieved in the transaction, and
stamp the object's stamp returned from a successful
call to Persistence.load(java.lang.Object, org.castor.persist.ProposedObject, java.lang.Object, org.exolab.castor.mapping.AccessMode)
. These arguments are null for objects
retrieved with an exclusive lock.
store
in interface Persistence
conn
- An open connectionfields
- The fields to storeidentity
- The object's identityoriginal
- The original fields, or nullstamp
- The object's stamp, or null
ObjectModifiedException
- The object has been modified
in persistence storage since it was last loaded
ObjectDeletedException
- Indicates the object has been
deleted from persistence storage
PersistenceException
- A persistence error occuredpublic void delete(java.lang.Object conn, java.lang.Object identity) throws PersistenceException
Persistence
Persistence.create(org.exolab.castor.jdo.Database, java.lang.Object, java.lang.Object[], java.lang.Object)
. After this method returns all
locks on the object must be retained until the transaction has
completed.
delete
in interface Persistence
conn
- An open connectionidentity
- The object's identity
PersistenceException
- A persistence error occuredpublic void writeLock(java.lang.Object conn, java.lang.Object identity) throws ObjectDeletedException, PersistenceException
Persistence
writeLock
in interface Persistence
conn
- An open connectionidentity
- The object's identity
ObjectDeletedException
- Indicates the object has been
deleted from persistence storage
PersistenceException
- A persistence error occuredpublic java.lang.Object load(java.lang.Object conn, ProposedObject proposedObject, java.lang.Object identity, AccessMode accessMode) throws ObjectNotFoundException, PersistenceException
store(java.lang.Object, java.lang.Object[], java.lang.Object, java.lang.Object[], java.lang.Object)
). If lock is true the object must be
locked in persistence storage to prevent concurrent updates.
load
in interface Persistence
conn
- An open connectionfields
- An Object[] to load field values intoidentity
- Identity of the object to load.accessMode
- The access mode (null equals shared)
ObjectNotFoundException
- The object was not found in persistent storage
PersistenceException
- A persistence error occuredpublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |