org.melati.poem
Class PersistentFactory
java.lang.Object
org.melati.poem.PersistentFactory
public final class PersistentFactory
- extends Object
A factory for persisting pojos and recreating them.
- Since:
- 14 Jun 2007
- Author:
- timp
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
fromInstance
public static Persistent fromInstance(Database db,
Object pojo)
- Parameters:
db
- database to look inpojo
- the instance to create a Persistent from.
- Returns:
- A new or existing persisted Persistent
populatedPersistent
public static Persistent populatedPersistent(Table table,
Object pojo)
- Parameters:
table
- the Table the persisted pojo is to be stored inpojo
- the object to populate the Persistent from
- Returns:
- A floating Persistent with fields populated from the given pojo
from
public static Object from(Persistent persistent,
Class<?> clazz)
throws NoSuchMethodException
- Reincarnate an object, populated from the store.
- Parameters:
persistent
- the Persistent to read fromclazz
- the class to create a new, populated instance of
- Returns:
- an instance of the given Class, populated from the given Persistent
- Throws:
NoSuchMethodException
Copyright © 2000-2010 PanEris. All Rights Reserved.