org.xorm.datastore.heap
Class HeapDriver

java.lang.Object
  |
  +--org.xorm.datastore.heap.HeapDriver
All Implemented Interfaces:
DatastoreDriver

public class HeapDriver
extends Object
implements DatastoreDriver

An exceedingly useless implementation of the DatastoreDriver interface: a non-persisted, in-memory representation of a database. Not a full implementation -- in particular, query methods and transactions are not implemented. But it can be used to see when certain operations would occur, or extended for an application that wanted to use "fake JDO" and provide its own keys for looking up bootstrap objects. When using this driver, XORM's second-level cache is the actual datastore (see HeapDatastore).

Author:
Wes Biggs

Constructor Summary
HeapDriver(InterfaceManagerFactory factory)
           
 
Method Summary
 void begin(boolean readOnly)
           
 void commit()
           
 int count(Selector selector)
          Returns the size of the results that would be returned by the query.
 void create(Row row)
          Creates (inserts) a new row in the datastore.
 void delete(Row row)
          Permanently deletes a single row from the datastore.
 void rollback()
           
 Collection select(Selector selector, Set extraRows)
          Selects from (queries) the datastore for rows matching the specified query conditions.
 void update(Row row)
          Updates a given row so that the datastore's values are in sync with those in the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeapDriver

public HeapDriver(InterfaceManagerFactory factory)
Method Detail

begin

public void begin(boolean readOnly)
Specified by:
begin in interface DatastoreDriver

commit

public void commit()
Specified by:
commit in interface DatastoreDriver

rollback

public void rollback()
Specified by:
rollback in interface DatastoreDriver

create

public void create(Row row)
Description copied from interface: DatastoreDriver
Creates (inserts) a new row in the datastore. If the table is configured for autoincrement or sequence ID generation, the object ID is generated using that method before the row is inserted.

Specified by:
create in interface DatastoreDriver

update

public void update(Row row)
Description copied from interface: DatastoreDriver
Updates a given row so that the datastore's values are in sync with those in the object.

Specified by:
update in interface DatastoreDriver

delete

public void delete(Row row)
Description copied from interface: DatastoreDriver
Permanently deletes a single row from the datastore.

Specified by:
delete in interface DatastoreDriver

select

public Collection select(Selector selector,
                         Set extraRows)
Description copied from interface: DatastoreDriver
Selects from (queries) the datastore for rows matching the specified query conditions.

Specified by:
select in interface DatastoreDriver
Parameters:
selector - the root of the parse tree representing the query
extraRows - a non-null set to which additional objects read from the datastore can be added, as advised by fetch group information and optimization choices.
Returns:
a collection of Row objects matching the selection criteria.

count

public int count(Selector selector)
Description copied from interface: DatastoreDriver
Returns the size of the results that would be returned by the query. A naive implementation would be to return select(selector, ...).size(). However, this allows datastores that provide a native count feature to use far less network and memory resources.

Specified by:
count in interface DatastoreDriver


$Header: /cvsroot/xorm/xorm/docs/api/org/xorm/datastore/heap/HeapDriver.html,v 1.1 2004/05/30 08:55:05 wbiggs Exp $