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
ClassAccessIF
load
in interface ClassAccessIF
Exception
public Object loadField(AccessRegistrarIF registrar, IdentityIF identity, int field)
ClassAccessIF
loadField
in interface ClassAccessIF
public Object loadFieldMultiple(AccessRegistrarIF registrar, Collection identities, IdentityIF current, int field)
ClassAccessIF
loadFieldMultiple
in interface ClassAccessIF
public void create(ObjectAccessIF oaccess, Object object) throws Exception
ClassAccessIF
create
in interface ClassAccessIF
Exception
public void delete(ObjectAccessIF oaccess, Object object) throws Exception
ClassAccessIF
delete
in interface ClassAccessIF
Exception
protected void bindParametersDelete(PreparedStatement stm, IdentityIF identity) throws Exception
Exception
public void storeDirty(ObjectAccessIF oaccess, Object object) throws Exception
ClassAccessIF
storeDirty
in interface ClassAccessIF
Exception
protected void storeAdded(ObjectAccessIF oaccess, IdentityIF identity, Collection elements) throws Exception
Exception
protected void bindParametersAddRemove(PreparedStatement stm, ObjectAccessIF oaccess, IdentityIF identity, Object element) throws Exception
Exception
protected void storeRemoved(ObjectAccessIF oaccess, IdentityIF identity, Collection elements) throws Exception
Exception