Package net.ontopia.persistence.proxy
Class SQLOneToOne
- java.lang.Object
-
- net.ontopia.persistence.proxy.SQLOneToOne
-
- All Implemented Interfaces:
FieldAccessIF
- Direct Known Subclasses:
SQLBatchOneToOne
public class SQLOneToOne extends Object implements FieldAccessIF
INTERNAL: Class that performs the task of accessing and manipulating 1:1 fields in the database.
-
-
Field Summary
Fields Modifier and Type Field Description protected RDBMSAccess
access
protected int
batchSize
protected boolean
close_stm
protected boolean
debug
protected FieldInfoIF
field
protected FieldInfoIF
identity_field
protected FieldInfoIF[]
select_fields
protected FieldInfoIF[]
select_fields_ref
protected int
select_value_index
protected String
sql_load
protected String
sql_load_multiple
protected String
sql_set
protected FieldInfoIF
value_field
-
Constructor Summary
Constructors Constructor Description SQLOneToOne(RDBMSAccess access, FieldInfoIF field)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear(IdentityIF identity)
INTERNAL: Clears the field value for the given object identity.protected void
executeUpdate(PreparedStatement stm, String sql)
Object
load(AccessRegistrarIF registrar, IdentityIF identity)
INTERNAL: Loads the field value for the given object identity.Object
loadMultiple(AccessRegistrarIF registrar, Collection<IdentityIF> identities, IdentityIF current)
INTERNAL: Loads the field value for all the given object identities.protected PreparedStatement
set_getStatement()
void
storeDirty(ObjectAccessIF oaccess, Object object)
INTERNAL: The object field is dirty and a call to this method should cause the field value to be updated.
-
-
-
Field Detail
-
debug
protected boolean debug
-
access
protected RDBMSAccess access
-
sql_load
protected String sql_load
-
sql_load_multiple
protected String sql_load_multiple
-
sql_set
protected String sql_set
-
identity_field
protected FieldInfoIF identity_field
-
select_fields
protected FieldInfoIF[] select_fields
-
select_fields_ref
protected FieldInfoIF[] select_fields_ref
-
value_field
protected FieldInfoIF value_field
-
field
protected FieldInfoIF field
-
select_value_index
protected int select_value_index
-
close_stm
protected boolean close_stm
-
batchSize
protected int batchSize
-
-
Constructor Detail
-
SQLOneToOne
public SQLOneToOne(RDBMSAccess access, FieldInfoIF field)
-
-
Method Detail
-
load
public Object load(AccessRegistrarIF registrar, IdentityIF identity) throws Exception
Description copied from interface:FieldAccessIF
INTERNAL: Loads the field value for the given object identity. The specified access registrar will be notified about the value(s) read from the database.- Specified by:
load
in interfaceFieldAccessIF
- Returns:
- The value loaded for the specific field. Note that if the field is a reference field the identity will be returned, not the actual object. This is because the storage system does not deal with persistent object instances directly.
- Throws:
IdentityNotFoundException
- if the identity was not found.Exception
-
loadMultiple
public Object loadMultiple(AccessRegistrarIF registrar, Collection<IdentityIF> identities, IdentityIF current) throws Exception
Description copied from interface:FieldAccessIF
INTERNAL: Loads the field value for all the given object identities. The specified access registrar will be notified about the value(s) read from the database.- Specified by:
loadMultiple
in interfaceFieldAccessIF
- Returns:
- The value loaded for the specific field for the current identity. Note that if the field is a reference field the identity will be returned, not the actual object. This is because the storage system does not deal with persistent object instances directly.
- Throws:
IdentityNotFoundException
- if the identity was not found.Exception
-
clear
public void clear(IdentityIF identity) throws Exception
Description copied from interface:FieldAccessIF
INTERNAL: Clears the field value for the given object identity. This method is only applicable for 1:M and M:M fields.- Specified by:
clear
in interfaceFieldAccessIF
- Throws:
Exception
-
storeDirty
public void storeDirty(ObjectAccessIF oaccess, Object object) throws Exception
Description copied from interface:FieldAccessIF
INTERNAL: The object field is dirty and a call to this method should cause the field value to be updated. Note that the field access may also store other field values if it decides to do so. After the field value(s) has been updated the dirty flag(s) should be set to false.- Specified by:
storeDirty
in interfaceFieldAccessIF
- Throws:
Exception
-
set_getStatement
protected PreparedStatement set_getStatement() throws SQLException
- Throws:
SQLException
-
executeUpdate
protected void executeUpdate(PreparedStatement stm, String sql) throws Exception
- Throws:
Exception
-
-