|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.imemex.dataservices.relation.AbstractDBMSRelation<E>
public abstract class AbstractDBMSRelation<E>
This class contains generic implementations of the relation interface using a DBMS table. We use the Template Method design pattern to concentrate data access code in this class that would otherwise have to be replicated among subclasses.
| Constructor Summary | |
|---|---|
AbstractDBMSRelation()
Instantiates a new AbstractDBMSRelation. |
|
AbstractDBMSRelation(DBMSRelationSchema schema)
Instantiates a new AbstractDBMSRelation with the given schema. |
|
| Method Summary | |
|---|---|
boolean |
add(E o)
|
boolean |
addAll(java.util.Collection<? extends E> c)
|
void |
clear()
|
void |
close()
Release resources allocated by this instance, such as its database connection. |
boolean |
contains(java.lang.Object o)
|
boolean |
containsAll(java.util.Collection<?> c)
|
void |
finalize()
On destruction, releases all resources allocated by this instance. |
E |
get(java.lang.String whereCondition,
java.lang.Object[] bindings)
Performs a query supposed to return only one element as a result. |
E |
getObjectFromTuple(java.sql.ResultSet rs,
java.lang.String[] columnNames)
Obtains an object representation of the tuple currently pointed by the result set. |
boolean |
hasUpdated()
Indicates whether an update happened during the last addAll operation. |
boolean |
isEmpty()
|
java.util.Iterator<E> |
iterator()
|
void |
optimize()
Performs optimization actions in the underlying implementation of the relation. |
PullOperator<E> |
query(java.lang.String whereCondition,
java.lang.Object[] bindings)
Obtains all elements that conform to the given condition. |
PullOperator<E> |
query(java.lang.String whereCondition,
java.lang.Object[] bindings,
java.lang.String orderByColumns)
Obtains all elements that conform to the given condition in the order specified in |
boolean |
remove(java.lang.Object o)
|
boolean |
remove(java.lang.String whereCondition,
java.lang.Object[] bindings)
Removes all elements specified by the given condition. |
boolean |
removeAll(java.util.Collection<?> c)
|
boolean |
retainAll(java.util.Collection c)
|
int |
size()
|
java.lang.Object[] |
toArray()
|
java.lang.Object[] |
toArray(java.lang.Object[] a)
|
boolean |
update(E metadata)
Updates the given element in the set. |
boolean |
update(java.lang.String setAssignments,
java.lang.Object[] setBindings,
java.lang.String whereCondition,
java.lang.Object[] whereBindings)
Updates the given relation by touching all elements specified by the given condition and changing them in the way specified in the given assigments. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Set |
|---|
equals, hashCode |
| Constructor Detail |
|---|
public AbstractDBMSRelation()
public AbstractDBMSRelation(DBMSRelationSchema schema)
schema - | Method Detail |
|---|
public boolean update(E metadata)
Relation
update in interface Relation<E>metadata - -
the element to be updated.
public boolean update(java.lang.String setAssignments,
java.lang.Object[] setBindings,
java.lang.String whereCondition,
java.lang.Object[] whereBindings)
Relation
update in interface Relation<E>setAssignments - -
the assigments to be placed in a SQL-set clause. As in
JDBC-style, all bind variables in the conditions should be
represented by "?" and their bound values should be given
positionally in the list setBindings - -
the values to be bound to the whereCondition - -
a condition to be used in a SQL-where clause. As in
JDBC-style, all bind variables in the conditions should be
represented by "?" and their bound values should be given
positionally in the list whereBindings - -
the values to be bound to the public int size()
size in interface java.util.Collection<E>size in interface java.util.Set<E>public void clear()
clear in interface java.util.Collection<E>clear in interface java.util.Set<E>public boolean isEmpty()
isEmpty in interface java.util.Collection<E>isEmpty in interface java.util.Set<E>public java.lang.Object[] toArray()
toArray in interface java.util.Collection<E>toArray in interface java.util.Set<E>public boolean add(E o)
add in interface java.util.Collection<E>add in interface java.util.Set<E>public boolean contains(java.lang.Object o)
contains in interface java.util.Collection<E>contains in interface java.util.Set<E>public boolean remove(java.lang.Object o)
remove in interface java.util.Collection<E>remove in interface java.util.Set<E>public java.lang.Object[] toArray(java.lang.Object[] a)
toArray in interface java.util.Collection<E>toArray in interface java.util.Set<E>public boolean addAll(java.util.Collection<? extends E> c)
addAll in interface java.util.Collection<E>addAll in interface java.util.Set<E>public boolean hasUpdated()
public boolean containsAll(java.util.Collection<?> c)
containsAll in interface java.util.Collection<E>containsAll in interface java.util.Set<E>public boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<E>removeAll in interface java.util.Set<E>
public boolean remove(java.lang.String whereCondition,
java.lang.Object[] bindings)
Relation
remove in interface Relation<E>whereCondition - -
a condition to be used in a SQL-where clause that qualifies
elements of the relation to be deleted. As in JDBC-style, all
bind variables in the conditions should be represented by "?"
and their bound values should be given positionally in the
list bindings - -
the values to be bound to the public boolean retainAll(java.util.Collection c)
retainAll in interface java.util.Collection<E>retainAll in interface java.util.Set<E>public java.util.Iterator<E> iterator()
iterator in interface java.lang.Iterable<E>iterator in interface java.util.Collection<E>iterator in interface java.util.Set<E>
public PullOperator<E> query(java.lang.String whereCondition,
java.lang.Object[] bindings)
Relation
query in interface Relation<E>whereCondition - -
a condition to be used in a SQL-where clause that qualifies
elements of the relation to be returned. As in JDBC-style, all
bind variables in the conditions should be represented by "?"
and their bound values should be given positionally in the
list bindings - -
the values to be bound to the
public PullOperator<E> query(java.lang.String whereCondition,
java.lang.Object[] bindings,
java.lang.String orderByColumns)
Relation
query in interface Relation<E>whereCondition - -
a condition to be used in a SQL-where clause that qualifies
elements of the relation to be returned. As in JDBC-style, all
bind variables in the conditions should be represented by "?"
and their bound values should be given positionally in the
list bindings - -
the values to be bound to the orderByColumns - -
the column list to be used in a SQL-order by clause that
defines the order in which elements in the resulting pull
operator are returned.
public E get(java.lang.String whereCondition,
java.lang.Object[] bindings)
Relation
get in interface Relation<E>whereCondition - -
a condition to be used in a SQL-where clause that qualifies
the specific element of the relation to be returned. As in
JDBC-style, all bind variables in the conditions should be
represented by "?" and their bound values should be given
positionally in the list bindings - -
the values to be bound to the public void optimize()
Relation
optimize in interface Relation<E>
public E getObjectFromTuple(java.sql.ResultSet rs,
java.lang.String[] columnNames)
TupleToObjectTranslator
getObjectFromTuple in interface TupleToObjectTranslator<E>rs - - the result set.columnNames - - the column names part of the schema respected by the
result set.
public void close()
Relation
close in interface Relation<E>public void finalize()
finalize in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||