|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.ontopia.persistence.proxy.RDBMSAccess
public class RDBMSAccess
INTERNAL: A storage access implementation accessing relational databases using JDBC.
Field Summary | |
---|---|
protected boolean |
batch_updates
|
protected boolean |
closed
|
protected java.sql.Connection |
conn_
|
protected java.util.Map<java.lang.Thread,java.sql.Connection> |
conn_map
|
protected boolean |
debug
|
protected java.util.Collection |
flushable
|
protected java.util.Map |
handlers
|
protected java.lang.String |
id
|
protected RDBMSMapping |
mapping
|
protected boolean |
readonly
|
protected RDBMSStorage |
storage
|
Constructor Summary | |
---|---|
RDBMSAccess(java.lang.String id,
RDBMSStorage storage,
boolean readonly)
|
Method Summary | |
---|---|
void |
abort()
INTERNAL: Aborts all changes performed in the transaction. |
void |
close()
INTERNAL: Closes the storage access, which allows it to free its resources. |
void |
commit()
INTERNAL: Commits the changes performed in the transaction. |
void |
createObject(ObjectAccessIF oaccess,
java.lang.Object object)
INTERNAL: Called by the transaction when it requests the new object to be created in the data repository. |
QueryIF |
createQuery(JDOQuery jdoquery,
ObjectAccessIF oaccess,
AccessRegistrarIF registrar,
boolean lookup_identities)
INTERNAL: Build a QueryIF from the specified JDO query instance. |
QueryIF |
createQuery(java.lang.String name,
ObjectAccessIF oaccess,
AccessRegistrarIF registrar)
INTERNAL: Creates a query instance for the given transaction. |
void |
deleteObject(ObjectAccessIF oaccess,
java.lang.Object object)
INTERNAL: Called by the transaction when it requests the object to be deleted in the data repository. |
void |
flush()
INTERNAL: Called when the transaction requires the transaction changes to be stored by the storage access (i.e. |
IdentityIF |
generateIdentity(java.lang.Object type)
INTERNAL: Called by the application when it requests a new object identity for a given object type. |
protected java.sql.Connection |
getConn()
|
java.sql.Connection |
getConnection()
INTERNAL: Returns the JDBC database connection used. |
protected ClassAccessIF |
getHandler(java.lang.Object type)
INTERNAL: Gets up the handler class that is used to manage objects of the given class. |
java.lang.String |
getId()
INTERNAL: Gets the storage access id. |
java.lang.String |
getProperty(java.lang.String property)
INTERNAL: Gets the value of the specified property. |
StorageIF |
getStorage()
INTERNAL: Returns the storage definition that the access uses. |
boolean |
isReadOnly()
INTERNAL: Returns true if the storage access is read-only. |
protected boolean |
isSQLException(java.lang.Throwable e)
|
java.lang.Object |
loadField(AccessRegistrarIF registrar,
IdentityIF identity,
int field)
INTERNAL: Requests the loading of the specified field for the given object identity. |
java.lang.Object |
loadFieldMultiple(AccessRegistrarIF registrar,
java.util.Collection identities,
IdentityIF current,
java.lang.Object type,
int field)
INTERNAL: Requests the loading of the specified field for all the given object identities. |
boolean |
loadObject(AccessRegistrarIF registrar,
IdentityIF identity)
INTERNAL: Check for the existence of the object identity in the data repository. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql)
|
protected void |
resetConnection()
|
protected void |
setConn(java.sql.Connection conn)
|
void |
storeDirty(ObjectAccessIF oaccess,
java.lang.Object object)
INTERNAL: Stores object fields that are dirty in the database. |
boolean |
validate()
INTERNAL: Returns true if the storage access is valid. |
protected boolean |
validateConnection(java.sql.Connection conn)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean debug
protected java.lang.String id
protected boolean readonly
protected RDBMSStorage storage
protected RDBMSMapping mapping
protected java.sql.Connection conn_
protected java.util.Map<java.lang.Thread,java.sql.Connection> conn_map
protected boolean closed
protected java.util.Map handlers
protected boolean batch_updates
protected java.util.Collection flushable
Constructor Detail |
---|
public RDBMSAccess(java.lang.String id, RDBMSStorage storage, boolean readonly)
Method Detail |
---|
public java.lang.String getId()
StorageAccessIF
getId
in interface StorageAccessIF
public StorageIF getStorage()
StorageAccessIF
getStorage
in interface StorageAccessIF
public boolean isReadOnly()
StorageAccessIF
isReadOnly
in interface StorageAccessIF
public java.lang.String getProperty(java.lang.String property)
StorageAccessIF
getProperty
in interface StorageAccessIF
protected java.sql.Connection getConn()
protected void setConn(java.sql.Connection conn)
public java.sql.Connection getConnection()
public java.sql.PreparedStatement prepareStatement(java.lang.String sql) throws java.sql.SQLException
java.sql.SQLException
protected void resetConnection()
protected boolean isSQLException(java.lang.Throwable e)
protected ClassAccessIF getHandler(java.lang.Object type)
public boolean validate()
StorageAccessIF
validate
in interface StorageAccessIF
protected boolean validateConnection(java.sql.Connection conn)
public void commit()
StorageAccessIF
commit
in interface StorageAccessIF
public void abort()
StorageAccessIF
abort
in interface StorageAccessIF
public void close()
StorageAccessIF
close
in interface StorageAccessIF
public void flush()
StorageAccessIF
This method exists mainly to allow storage access implementations to optimize its communication with data repositories. An example of this is writing transaction changes in batches to improve performance.
Note that the transaction will always call this method at the end of its store method. It will do this so that it is sure that the changes will be visible inside the data repository.
flush
in interface StorageAccessIF
public boolean loadObject(AccessRegistrarIF registrar, IdentityIF identity)
StorageAccessIF
loadObject
in interface StorageAccessIF
public java.lang.Object loadField(AccessRegistrarIF registrar, IdentityIF identity, int field)
StorageAccessIF
loadField
in interface StorageAccessIF
public java.lang.Object loadFieldMultiple(AccessRegistrarIF registrar, java.util.Collection identities, IdentityIF current, java.lang.Object type, int field)
StorageAccessIF
loadFieldMultiple
in interface StorageAccessIF
public void createObject(ObjectAccessIF oaccess, java.lang.Object object)
StorageAccessIF
createObject
in interface StorageAccessIF
public void deleteObject(ObjectAccessIF oaccess, java.lang.Object object)
StorageAccessIF
deleteObject
in interface StorageAccessIF
public void storeDirty(ObjectAccessIF oaccess, java.lang.Object object)
StorageAccessIF
storeDirty
in interface StorageAccessIF
public QueryIF createQuery(java.lang.String name, ObjectAccessIF oaccess, AccessRegistrarIF registrar)
StorageAccessIF
createQuery
in interface StorageAccessIF
public QueryIF createQuery(JDOQuery jdoquery, ObjectAccessIF oaccess, AccessRegistrarIF registrar, boolean lookup_identities)
StorageAccessIF
createQuery
in interface StorageAccessIF
public IdentityIF generateIdentity(java.lang.Object type)
StorageAccessIF
generateIdentity
in interface StorageAccessIF
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |