net.ontopia.persistence.proxy
Class SQLCollectionAccess

java.lang.Object
  extended by net.ontopia.persistence.proxy.SQLCollectionAccess
All Implemented Interfaces:
ClassAccessIF

public class SQLCollectionAccess
extends java.lang.Object
implements ClassAccessIF

INTERNAL: Class that performs the task of accessing and manipulating "collection" type instances in the database.

NOTE: Collection type instances must have an identity field and exactly one value field.


Field Summary
protected  RDBMSAccess access
           
protected  ClassInfoIF cinfo
           
protected  boolean debug
           
protected  FieldInfoIF identity_field
           
protected  java.lang.String sql_add
           
protected  java.lang.String sql_delete
           
protected  java.lang.String sql_load
           
protected  java.lang.String sql_remove
           
protected  FieldInfoIF value_field
           
 
Constructor Summary
SQLCollectionAccess(RDBMSAccess access, ClassInfoIF cinfo)
           
 
Method Summary
protected  void bindParametersAddRemove(java.sql.PreparedStatement stm, ObjectAccessIF oaccess, IdentityIF identity, java.lang.Object element)
           
protected  void bindParametersDelete(java.sql.PreparedStatement stm, IdentityIF identity)
           
 void create(ObjectAccessIF oaccess, java.lang.Object object)
          INTERNAL: Creates the new object in the database.
 void delete(ObjectAccessIF oaccess, java.lang.Object object)
          INTERNAL: Deletes the object identity from the database.
 boolean load(AccessRegistrarIF registrar, IdentityIF identity)
          INTERNAL: Loads the object identity from the database.
 java.lang.Object loadField(AccessRegistrarIF registrar, IdentityIF identity, int field)
          INTERNAL: Loads the specified object field for the given identity from the database.
 java.lang.Object loadFieldMultiple(AccessRegistrarIF registrar, java.util.Collection identities, IdentityIF current, int field)
          INTERNAL: Loads the specified object field for the given identitys from the database.
protected  void storeAdded(ObjectAccessIF oaccess, IdentityIF identity, java.util.Collection elements)
           
 void storeDirty(ObjectAccessIF oaccess, java.lang.Object object)
          INTERNAL: Stores object fields that are dirty in the database.
protected  void storeRemoved(ObjectAccessIF oaccess, IdentityIF identity, java.util.Collection elements)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

protected boolean debug

access

protected RDBMSAccess access

cinfo

protected ClassInfoIF cinfo

sql_load

protected java.lang.String sql_load

sql_add

protected java.lang.String sql_add

sql_remove

protected java.lang.String sql_remove

sql_delete

protected java.lang.String sql_delete

identity_field

protected FieldInfoIF identity_field

value_field

protected FieldInfoIF value_field
Constructor Detail

SQLCollectionAccess

public SQLCollectionAccess(RDBMSAccess access,
                           ClassInfoIF cinfo)
Method Detail

load

public boolean load(AccessRegistrarIF registrar,
                    IdentityIF identity)
             throws java.lang.Exception
Description copied from interface: ClassAccessIF
INTERNAL: Loads the object identity from the database.

Specified by:
load in interface ClassAccessIF
Returns:
true if object was found in the data store, false otherwise.
Throws:
java.lang.Exception

loadField

public java.lang.Object loadField(AccessRegistrarIF registrar,
                                  IdentityIF identity,
                                  int field)
Description copied from interface: ClassAccessIF
INTERNAL: Loads the specified object field for the given identity from the database.

Specified by:
loadField in interface ClassAccessIF

loadFieldMultiple

public java.lang.Object loadFieldMultiple(AccessRegistrarIF registrar,
                                          java.util.Collection identities,
                                          IdentityIF current,
                                          int field)
Description copied from interface: ClassAccessIF
INTERNAL: Loads the specified object field for the given identitys from the database.

Specified by:
loadFieldMultiple in interface ClassAccessIF

create

public void create(ObjectAccessIF oaccess,
                   java.lang.Object object)
            throws java.lang.Exception
Description copied from interface: ClassAccessIF
INTERNAL: Creates the new object in the database. Note that the object identity can be extracted from the object using the supplied object access instance.

Specified by:
create in interface ClassAccessIF
Throws:
java.lang.Exception

delete

public void delete(ObjectAccessIF oaccess,
                   java.lang.Object object)
            throws java.lang.Exception
Description copied from interface: ClassAccessIF
INTERNAL: Deletes the object identity from the database.

Specified by:
delete in interface ClassAccessIF
Throws:
java.lang.Exception

bindParametersDelete

protected void bindParametersDelete(java.sql.PreparedStatement stm,
                                    IdentityIF identity)
                             throws java.lang.Exception
Throws:
java.lang.Exception

storeDirty

public void storeDirty(ObjectAccessIF oaccess,
                       java.lang.Object object)
                throws java.lang.Exception
Description copied from interface: ClassAccessIF
INTERNAL: Stores object fields that are dirty in the database. Note that the object identity can be extracted from the object using the supplied object access instance.

Specified by:
storeDirty in interface ClassAccessIF
Throws:
java.lang.Exception

storeAdded

protected void storeAdded(ObjectAccessIF oaccess,
                          IdentityIF identity,
                          java.util.Collection elements)
                   throws java.lang.Exception
Throws:
java.lang.Exception

bindParametersAddRemove

protected void bindParametersAddRemove(java.sql.PreparedStatement stm,
                                       ObjectAccessIF oaccess,
                                       IdentityIF identity,
                                       java.lang.Object element)
                                throws java.lang.Exception
Throws:
java.lang.Exception

storeRemoved

protected void storeRemoved(ObjectAccessIF oaccess,
                            IdentityIF identity,
                            java.util.Collection elements)
                     throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2000-2012 Ontopia.