Package net.ontopia.persistence.proxy
Class SQLObjectAccess
- java.lang.Object
-
- net.ontopia.persistence.proxy.SQLObjectAccess
-
- All Implemented Interfaces:
ClassAccessIF
- Direct Known Subclasses:
SQLBatchObjectAccess
public class SQLObjectAccess extends Object implements ClassAccessIF
INTERNAL: Class that performs the task of accessing and manipulating "identifiable object type" instances in the database.
-
-
Field Summary
Fields Modifier and Type Field Description protected RDBMSAccess
access
static int
batchSize
protected ClassInfoIF
cinfo
protected boolean
debug
protected FieldAccessIF[]
faccesses
protected FieldInfoIF
identity_field
protected FieldInfoIF[]
m2m_fields
protected FieldInfoIF[]
o2a_fields
protected FieldInfoIF[]
o2o_fields
protected String
sql_create
protected String
sql_delete
protected String
sql_load
protected FieldInfoIF[]
value_fields
-
Constructor Summary
Constructors Constructor Description SQLObjectAccess(RDBMSAccess access, ClassInfoIF cinfo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
bindParametersCreate(PreparedStatement stm, ObjectAccessIF oaccess, Object object)
protected void
bindParametersDelete(PreparedStatement stm, IdentityIF identity)
protected void
clearFields(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.protected FieldAccessIF
getFieldAccess(int field)
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<IdentityIF> identities, IdentityIF current, int field)
INTERNAL: Loads the specified object field for the given identitys from the database.void
storeDirty(ObjectAccessIF oaccess, Object object)
INTERNAL: Stores object fields that are dirty in the database.
-
-
-
Field Detail
-
batchSize
public static int batchSize
-
debug
protected boolean debug
-
access
protected RDBMSAccess access
-
cinfo
protected ClassInfoIF cinfo
-
sql_load
protected String sql_load
-
sql_create
protected String sql_create
-
sql_delete
protected String sql_delete
-
identity_field
protected FieldInfoIF identity_field
-
value_fields
protected FieldInfoIF[] value_fields
-
o2o_fields
protected FieldInfoIF[] o2o_fields
-
o2a_fields
protected FieldInfoIF[] o2a_fields
-
m2m_fields
protected FieldInfoIF[] m2m_fields
-
faccesses
protected FieldAccessIF[] faccesses
-
-
Constructor Detail
-
SQLObjectAccess
public SQLObjectAccess(RDBMSAccess access, ClassInfoIF cinfo)
-
-
Method Detail
-
getFieldAccess
protected FieldAccessIF getFieldAccess(int field)
-
load
public boolean load(AccessRegistrarIF registrar, IdentityIF identity) throws Exception
Description copied from interface:ClassAccessIF
INTERNAL: Loads the object identity from the database.- Specified by:
load
in interfaceClassAccessIF
- Returns:
- true if object was found in the data store, false otherwise.
- Throws:
Exception
-
loadField
public 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 interfaceClassAccessIF
-
loadFieldMultiple
public Object loadFieldMultiple(AccessRegistrarIF registrar, Collection<IdentityIF> 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 interfaceClassAccessIF
-
create
public void create(ObjectAccessIF oaccess, Object object) throws 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 interfaceClassAccessIF
- Throws:
Exception
-
bindParametersCreate
protected void bindParametersCreate(PreparedStatement stm, ObjectAccessIF oaccess, Object object) throws Exception
- Throws:
Exception
-
delete
public void delete(ObjectAccessIF oaccess, Object object) throws Exception
Description copied from interface:ClassAccessIF
INTERNAL: Deletes the object identity from the database.- Specified by:
delete
in interfaceClassAccessIF
- Throws:
Exception
-
bindParametersDelete
protected void bindParametersDelete(PreparedStatement stm, IdentityIF identity) throws Exception
- Throws:
Exception
-
clearFields
protected void clearFields(IdentityIF identity) throws Exception
- Throws:
Exception
-
storeDirty
public void storeDirty(ObjectAccessIF oaccess, Object object) throws 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 interfaceClassAccessIF
- Throws:
Exception
-
-