com.redhat.persistence
Class Session

java.lang.Object
  extended bycom.redhat.persistence.Session

public class Session
extends Object

A Session object provides the primary means for client Java code to interact with the persistence layer. This code is either Java code using the persistence layer to implement object persistence, or Java code working with persistent objects.

Version:
$Revision: #14 $ $Date: 2004/04/07 $
Author:
rhs@mit.edu

Field Summary
static String LINK_ASSOCIATION
           
static String versionId
           
 
Constructor Summary
Session(Root root, Engine engine, QuerySource source)
           
 
Method Summary
 Object add(Object obj, Property prop, Object value)
           
 void addAfterActivate(EventProcessor ep)
           
 void addAfterFlush(EventProcessor ep)
           
 void addBeforeDelete(EventProcessor ep)
          Before delete event processors are sent events associated with deletes and removes that cause deletes.
 void addBeforeFlush(EventProcessor ep)
           
 void assertFlushed(Object obj)
           
 void clear(Object obj, Property prop)
           
 void commit()
          Renders all changes made within the transaction permanent and ends the transaction.
 void create(Object obj)
           
 boolean delete(Object obj)
           
 void flush()
          Performs all operations queued up by the session.
 void flushAll()
           
 Object get(Object obj, Property prop)
           
 DataSet getDataSet(Object obj)
           
 DataSet getDataSet(Object obj, Property prop)
           
 DataSet getDataSet(ObjectType type)
           
 DataSet getDataSet(PropertyMap keys)
           
 Object getObject(PropertyMap pmap)
           
 ObjectMap getObjectMap(Object obj)
           
 ObjectType getObjectType(Object obj)
           
 PropertyMap getProperties(Object obj)
           
 QuerySource getQuerySource()
           
 Root getRoot()
           
 boolean isDeleted(Object obj)
           
 boolean isFlushed()
           
 boolean isFlushed(Object obj)
           
 boolean isFlushed(Object obj, Property prop)
           
 boolean isModified(Object obj)
           
 boolean isNew(Object obj)
           
 boolean isPersisted(Object obj)
           
 void releaseObject(Object obj)
          Forces this session to release references to the specified object from its internal caches.
 void remove(Object obj, Property prop, Object value)
           
 Object retrieve(PropertyMap keys)
           
 void rollback()
          Reverts all changes made within the transaction and ends the transaction.
 void set(Object obj, Property prop, Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values

LINK_ASSOCIATION

public static final String LINK_ASSOCIATION
See Also:
Constant Field Values
Constructor Detail

Session

public Session(Root root,
               Engine engine,
               QuerySource source)
Method Detail

getRoot

public Root getRoot()

getQuerySource

public QuerySource getQuerySource()

retrieve

public Object retrieve(PropertyMap keys)

get

public Object get(Object obj,
                  Property prop)

getDataSet

public DataSet getDataSet(ObjectType type)

getDataSet

public DataSet getDataSet(PropertyMap keys)

getDataSet

public DataSet getDataSet(Object obj)

getDataSet

public DataSet getDataSet(Object obj,
                          Property prop)

create

public void create(Object obj)

delete

public boolean delete(Object obj)

set

public void set(Object obj,
                Property prop,
                Object value)

add

public Object add(Object obj,
                  Property prop,
                  Object value)

remove

public void remove(Object obj,
                   Property prop,
                   Object value)

clear

public void clear(Object obj,
                  Property prop)

getObject

public Object getObject(PropertyMap pmap)

getObjectType

public ObjectType getObjectType(Object obj)

getObjectMap

public ObjectMap getObjectMap(Object obj)

getProperties

public PropertyMap getProperties(Object obj)

isFlushed

public boolean isFlushed()
Returns:
true iff this session has outstanding events

isNew

public boolean isNew(Object obj)

isDeleted

public boolean isDeleted(Object obj)

isModified

public boolean isModified(Object obj)

isFlushed

public boolean isFlushed(Object obj)

assertFlushed

public void assertFlushed(Object obj)

isFlushed

public boolean isFlushed(Object obj,
                         Property prop)

isPersisted

public boolean isPersisted(Object obj)

flush

public void flush()
Performs all operations queued up by the session. This is automatically called when necessary in order to insure that queries performed by the datastore are consistent with the contents of the in memory data cache.


flushAll

public void flushAll()

commit

public void commit()
Renders all changes made within the transaction permanent and ends the transaction.


rollback

public void rollback()
Reverts all changes made within the transaction and ends the transaction.


releaseObject

public void releaseObject(Object obj)
Forces this session to release references to the specified object from its internal caches. Events that point to this object continue to do so.

Parameters:
obj - the object to release. It should not be nul

addBeforeDelete

public void addBeforeDelete(EventProcessor ep)
Before delete event processors are sent events associated with deletes and removes that cause deletes. They have some constraints. It is illegal to add objects to roles that are being deleted by the set of events being activated. In other words, don't put an object in a position in the object graph that would imply that it should be deleted as a consequence of any delete event being activated.


addAfterActivate

public void addAfterActivate(EventProcessor ep)

addBeforeFlush

public void addBeforeFlush(EventProcessor ep)

addAfterFlush

public void addAfterFlush(EventProcessor ep)


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 20 2004:2337 UTC