org.apache.struts2.showcase.application
Class MemoryStorage

java.lang.Object
  extended by org.apache.struts2.showcase.application.MemoryStorage
All Implemented Interfaces:
Serializable, Storage

public class MemoryStorage
extends Object
implements Storage

MemoryStorage. Very simple in-memory persistence emulation.

See Also:
Serialized Form

Constructor Summary
MemoryStorage()
           
 
Method Summary
 Serializable create(IdEntity object)
           
 int delete(Class entityClass, Serializable id)
           
 int delete(IdEntity object)
           
 Collection findAll(Class entityClass)
           
 IdEntity get(Class entityClass, Serializable id)
           
 Serializable merge(IdEntity object)
           
 void reset()
           
 IdEntity update(IdEntity object)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryStorage

public MemoryStorage()
Method Detail

get

public IdEntity get(Class entityClass,
                    Serializable id)
Specified by:
get in interface Storage

create

public Serializable create(IdEntity object)
                    throws CreateException
Specified by:
create in interface Storage
Throws:
CreateException

update

public IdEntity update(IdEntity object)
                throws UpdateException
Specified by:
update in interface Storage
Throws:
UpdateException

merge

public Serializable merge(IdEntity object)
                   throws StorageException
Specified by:
merge in interface Storage
Throws:
StorageException

delete

public int delete(Class entityClass,
                  Serializable id)
           throws CreateException
Specified by:
delete in interface Storage
Throws:
CreateException

delete

public int delete(IdEntity object)
           throws CreateException
Specified by:
delete in interface Storage
Throws:
CreateException

findAll

public Collection findAll(Class entityClass)
Specified by:
findAll in interface Storage

reset

public void reset()


Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.