Arch4J 1.1

org.arch4j.persistence
Interface PersistenceManager

All Known Implementing Classes:
CastorPersistenceManager

public interface PersistenceManager

Author:
alwick

Method Summary
 void beginTransaction()
          Begin a transaction.
 void close()
          Close the connection.
 void commit()
          Commit the transaction.
 void create(Object anObject)
          Create a new object.
 void create(Object anObject, boolean isDeepCreate)
          Create a new object.
 Collection getObjects(ObjectQuery aQuery)
          Get all objects for the given query object.
 Collection getObjects(String aQueryString)
          Get all objects for the given query string.
 ObjectQuery getQuery(String anOQLQueryString)
          Gets the query object for a given query.
 boolean isPersistent(Object anObject)
          Is this object recognized by the current transaction.
 Object load(Class type, Object identity)
          Load the specified instance.
 void remove(Object anObject)
          Remove the object.
 void rollback()
          Rollback the transaction.
 void setDefaultDeepOrShallow(boolean isDeep)
          Specifies if upcoming transactions will perform deep or shallow updates and creates.
 void update(Object anObject)
          Update the object state.
 void update(Object anObject, boolean isDeepUpdate)
          Update the object state.
 boolean validateTransaction()
           
 

Method Detail

update

public void update(Object anObject,
                   boolean isDeepUpdate)
            throws PersistenceException
Update the object state.

Parameters:
isDeepUpdate - If true then navigate the object graph and mark the root and all children to be updated. Otherwise, update only the root object.
PersistenceException

create

public void create(Object anObject,
                   boolean isDeepCreate)
            throws PersistenceException
Create a new object.

Parameters:
isDeepCreate - If true then navigate the object graph and mark the root and all children to be created. Otherwise, create only the root object.
PersistenceException

setDefaultDeepOrShallow

public void setDefaultDeepOrShallow(boolean isDeep)
                             throws PersistenceException
Specifies if upcoming transactions will perform deep or shallow updates and creates.

PersistenceException

update

public void update(Object anObject)
            throws PersistenceException
Update the object state.

PersistenceException

create

public void create(Object anObject)
            throws PersistenceException
Create a new object.

PersistenceException

isPersistent

public boolean isPersistent(Object anObject)
                     throws PersistenceException
Is this object recognized by the current transaction.

PersistenceException

load

public Object load(Class type,
                   Object identity)
            throws PersistenceException
Load the specified instance. This is the same as querying for the single instance specified by the primary key.

Parameters:
type - the class type to populate and return
identity - the primary key used to identify the instance (note that complex primary keys will be supported in a future release)
Returns:
the instance if it exists, otherwise null
PersistenceException

close

public void close()
           throws PersistenceException
Close the connection.

PersistenceException

remove

public void remove(Object anObject)
            throws PersistenceException
Remove the object.

PersistenceException

getObjects

public Collection getObjects(String aQueryString)
                      throws PersistenceException
Get all objects for the given query string.

PersistenceException

getObjects

public Collection getObjects(ObjectQuery aQuery)
                      throws PersistenceException
Get all objects for the given query object.

Parameters:
aQuery - The query object to use for the query.
Returns:
The objects that match the query.
PersistenceException

beginTransaction

public void beginTransaction()
                      throws PersistenceException
Begin a transaction.

PersistenceException

commit

public void commit()
            throws PersistenceException
Commit the transaction.

PersistenceException

rollback

public void rollback()
              throws PersistenceException
Rollback the transaction.

PersistenceException

getQuery

public ObjectQuery getQuery(String anOQLQueryString)
                     throws PersistenceException
Gets the query object for a given query.

PersistenceException

validateTransaction

public boolean validateTransaction()
                            throws PersistenceException
PersistenceException

Arch4J 1.1

Copyright © 2000-2004 SpiderLogic, a service of Wipfli Ullrich Bertelson LLP.