public class SQLCollectionAccess extends Object implements ClassAccessIF
NOTE: Collection type instances must have an identity field and exactly one value field.
| Modifier and Type | Field and Description |
|---|---|
protected RDBMSAccess |
access |
protected ClassInfoIF |
cinfo |
protected boolean |
debug |
protected FieldInfoIF |
identity_field |
protected String |
sql_add |
protected String |
sql_delete |
protected String |
sql_load |
protected String |
sql_remove |
protected FieldInfoIF |
value_field |
| Constructor and Description |
|---|
SQLCollectionAccess(RDBMSAccess access,
ClassInfoIF cinfo) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
bindParametersAddRemove(PreparedStatement stm,
ObjectAccessIF oaccess,
IdentityIF identity,
Object element) |
protected void |
bindParametersDelete(PreparedStatement stm,
IdentityIF identity) |
void |
create(ObjectAccessIF oaccess,
Object object)
INTERNAL: Creates the new object in the database.
|
void |
delete(ObjectAccessIF oaccess,
Object object)
INTERNAL: Deletes the object identity from the database.
|
boolean |
load(AccessRegistrarIF registrar,
IdentityIF identity)
INTERNAL: Loads the object identity from the database.
|
Object |
loadField(AccessRegistrarIF registrar,
IdentityIF identity,
int field)
INTERNAL: Loads the specified object field for the given identity
from the database.
|
Object |
loadFieldMultiple(AccessRegistrarIF registrar,
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,
Collection elements) |
void |
storeDirty(ObjectAccessIF oaccess,
Object object)
INTERNAL: Stores object fields that are dirty in the
database.
|
protected void |
storeRemoved(ObjectAccessIF oaccess,
IdentityIF identity,
Collection elements) |
protected boolean debug
protected RDBMSAccess access
protected ClassInfoIF cinfo
protected String sql_load
protected String sql_add
protected String sql_remove
protected String sql_delete
protected FieldInfoIF identity_field
protected FieldInfoIF value_field
public SQLCollectionAccess(RDBMSAccess access, ClassInfoIF cinfo)
public boolean load(AccessRegistrarIF registrar, IdentityIF identity) throws Exception
ClassAccessIFload in interface ClassAccessIFExceptionpublic Object loadField(AccessRegistrarIF registrar, IdentityIF identity, int field)
ClassAccessIFloadField in interface ClassAccessIFpublic Object loadFieldMultiple(AccessRegistrarIF registrar, Collection identities, IdentityIF current, int field)
ClassAccessIFloadFieldMultiple in interface ClassAccessIFpublic void create(ObjectAccessIF oaccess, Object object) throws Exception
ClassAccessIFcreate in interface ClassAccessIFExceptionpublic void delete(ObjectAccessIF oaccess, Object object) throws Exception
ClassAccessIFdelete in interface ClassAccessIFExceptionprotected void bindParametersDelete(PreparedStatement stm, IdentityIF identity) throws Exception
Exceptionpublic void storeDirty(ObjectAccessIF oaccess, Object object) throws Exception
ClassAccessIFstoreDirty in interface ClassAccessIFExceptionprotected void storeAdded(ObjectAccessIF oaccess, IdentityIF identity, Collection elements) throws Exception
Exceptionprotected void bindParametersAddRemove(PreparedStatement stm, ObjectAccessIF oaccess, IdentityIF identity, Object element) throws Exception
Exceptionprotected void storeRemoved(ObjectAccessIF oaccess, IdentityIF identity, Collection elements) throws Exception
Exception