|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.triactive.jdo.sco.Set
A set object which is backed "directly" by the database. SCO fields declared as type java.util.Collection or java.util.Set are populated with objects of this type whenever the field is actively being managed by the state manager.
This class differs from HashSet primarily in
the fact that the contents of the set are not mirrored in memory.
Operations on the set "pass through" directly to the database.
An instance of this class "disconnects" from it backing storage whenever
unsetOwner() is called.
This occurs automatically in a variety of scenarios, such as when the object
is cloned or when its owning object (the one whose Set field refers to it)
transitions to a transient state.
When a disconnect occurs, the object switches to being backed by a normal
in-memory HashSet and subsequently behaves like a normal HashSet.
If the disconnect occurs during a transaction the contents of the set are
fully loaded from the database.
Subsequent changes to the set affect only the in-memory copy.
Once disconnected from its owner, an instance is never reconnected.
| Constructor Summary | |
|
Set(StateManager ownerSM,
java.lang.String fieldName)
|
(package private) |
Set(StateManager ownerSM,
java.lang.String fieldName,
boolean allowNulls,
SetStore setStore)
|
|
Set(StateManager ownerSM,
java.lang.String fieldName,
java.lang.Class elementType,
boolean allowNulls)
|
| Method Summary | |
boolean |
add(java.lang.Object element)
|
boolean |
addAll(java.util.Collection c)
|
void |
applyUpdates()
Applies any pending updates for this object to the data store. |
void |
clear()
|
java.lang.Object |
clone()
Creates and returns a copy of this object. |
boolean |
contains(java.lang.Object element)
|
boolean |
containsAll(java.util.Collection c)
|
boolean |
equals(java.lang.Object o)
|
java.lang.String |
getFieldName()
Returns the field name. |
java.lang.Object |
getOwner()
Returns the owner object of the SCO instance. |
int |
hashCode()
|
boolean |
isEmpty()
|
java.util.Iterator |
iterator()
|
void |
makeDirty()
Marks object dirty. |
QueryStatement |
newQueryStatement()
Returns a prototypical query statement over the underlying collection. |
QueryStatement |
newQueryStatement(java.lang.Class candidateClass)
Returns a prototypical query statement over the underlying collection, pre-filtered to include only objects of the specified class. |
Query.ResultObjectFactory |
newResultObjectFactory(QueryStatement stmt)
Returns a suitable query result factory for results produced by the specified query. |
boolean |
remove(java.lang.Object element)
|
boolean |
removeAll(java.util.Collection c)
|
boolean |
retainAll(java.util.Collection c)
|
void |
setValueFrom(java.lang.Object o)
Assigns the value of this second-class object from an existing object of the same or compatible type. |
int |
size()
|
java.lang.Object[] |
toArray()
|
java.lang.Object[] |
toArray(java.lang.Object[] a)
|
java.lang.String |
toString()
|
void |
unsetOwner()
Nullifies references to the owner Object and Field. |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Set(StateManager ownerSM,
java.lang.String fieldName)
public Set(StateManager ownerSM,
java.lang.String fieldName,
java.lang.Class elementType,
boolean allowNulls)
Set(StateManager ownerSM,
java.lang.String fieldName,
boolean allowNulls,
SetStore setStore)
| Method Detail |
public void setValueFrom(java.lang.Object o)
SCO
setValueFrom in interface SCOo - the object from which to copy the value.public java.lang.String getFieldName()
SCO
getFieldName in interface SCOpublic java.lang.Object getOwner()
SCO
getOwner in interface SCOpublic void unsetOwner()
SCO
unsetOwner in interface SCOpublic void applyUpdates()
SCO
applyUpdates in interface SCOpublic void makeDirty()
SCO
makeDirty in interface SCOpublic QueryStatement newQueryStatement()
QueryableThe returned query statement selects all applicable rows from the relevant base table(s) and the column that represents the element or element ID. The statement can then be modified to join additional tables, select more columns, add WHERE conditions, etc.
newQueryStatement in interface Queryablepublic QueryStatement newQueryStatement(java.lang.Class candidateClass)
Queryable
newQueryStatement in interface QueryableQueryable.newQueryStatement()public Query.ResultObjectFactory newResultObjectFactory(QueryStatement stmt)
QueryableThe stmt argument must have been obtained by a previous call to newQueryStatement() on the same Queryable.
newResultObjectFactory in interface Queryablepublic java.lang.Object clone()
Mutable second-class Objects are required to provide a public clone method in order to allow for copying PersistenceCapable objects. In contrast to Object.clone(), this method must not throw a CloneNotSupportedException.
public boolean equals(java.lang.Object o)
equals in interface java.util.Setpublic int hashCode()
hashCode in interface java.util.Setpublic java.util.Iterator iterator()
iterator in interface java.util.Setpublic int size()
size in interface java.util.Setpublic boolean isEmpty()
isEmpty in interface java.util.Setpublic boolean contains(java.lang.Object element)
contains in interface java.util.Setpublic boolean add(java.lang.Object element)
add in interface java.util.Setpublic boolean remove(java.lang.Object element)
remove in interface java.util.Setpublic void clear()
clear in interface java.util.Setpublic boolean addAll(java.util.Collection c)
addAll in interface java.util.Setpublic boolean containsAll(java.util.Collection c)
containsAll in interface java.util.Setpublic boolean removeAll(java.util.Collection c)
removeAll in interface java.util.Setpublic boolean retainAll(java.util.Collection c)
retainAll in interface java.util.Setpublic java.lang.Object[] toArray()
toArray in interface java.util.Setpublic java.lang.Object[] toArray(java.lang.Object[] a)
toArray in interface java.util.Setpublic java.lang.String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||