com.bm.creators
Class EntityInstanceCreator<T>

java.lang.Object
  extended by com.bm.creators.EntityInstanceCreator<T>
Type Parameters:
T - - the type of the class to create

public class EntityInstanceCreator<T>
extends java.lang.Object

This class creates instances of different classes with random data, like entity beans, inner classes etc..

Since:
07.10.2005
Author:
Daniel Wiese

Constructor Summary
EntityInstanceCreator(javax.persistence.EntityManager em, Introspector<T> intro, java.lang.Class<T> toCreate, java.util.List<Generator<?>> generators)
          Default constructor.
 
Method Summary
 void cleanup()
          This method should be called every time before an entity creation task > this method tells every generator to call his cleanup method (annotation).
 T createInstance()
          Creates a instance of the class (filled with random data).
 void prepare()
          This method should be called every time before an entity creation task > this method tells every generator to call his prepare method(annotation).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityInstanceCreator

public EntityInstanceCreator(javax.persistence.EntityManager em,
                             Introspector<T> intro,
                             java.lang.Class<T> toCreate,
                             java.util.List<Generator<?>> generators)
Default constructor.

Parameters:
em - - the current entity manager.
intro - - different types of introspectors
toCreate - - the class to create
generators - - the generator list
Method Detail

prepare

public void prepare()
This method should be called every time before an entity creation task > this method tells every generator to call his prepare method(annotation).


cleanup

public void cleanup()
This method should be called every time before an entity creation task > this method tells every generator to call his cleanup method (annotation).


createInstance

public T createInstance()
Creates a instance of the class (filled with random data).

Returns:
-a filled instance of the class (@see DataGenerator)


Copyright © 2008. All Rights Reserved.