com.bm.creators
Class EntityBeanCreator<T>

java.lang.Object
  extended by com.bm.creators.EntityBeanCreator<T>
Type Parameters:
T - - the type of the entity beans which will be created

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

This class creates entity beans with random data.

Since:
07.10.2005
Author:
Daniel Wiese

Constructor Summary
EntityBeanCreator(javax.persistence.EntityManager em, java.lang.Class<T> toCreate)
          Deafult constructor.
EntityBeanCreator(javax.persistence.EntityManager em, EntityBeanIntrospector<T> intro, java.lang.Class<T> toCreate)
          Deafult constructor.
EntityBeanCreator(javax.persistence.EntityManager em, EntityBeanIntrospector<T> intro, java.lang.Class<T> toCreate, java.util.List<Generator<?>> additionalGenerators)
          Constructor with special generator list.
 
Method Summary
 void cleanup()
          This method should be called every time before an entity creation task > this method tells every generator to call his clenup method (annotation).
 T createBeanInstance()
          Creates a instance of the entyty bean (filled with random data) without any persistence operations.
 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

EntityBeanCreator

public EntityBeanCreator(javax.persistence.EntityManager em,
                         java.lang.Class<T> toCreate)
Deafult constructor.

Parameters:
toCreate - - the class to create

EntityBeanCreator

public EntityBeanCreator(javax.persistence.EntityManager em,
                         EntityBeanIntrospector<T> intro,
                         java.lang.Class<T> toCreate)
Deafult constructor.

Parameters:
em - the current entity manager.
intro - - a isntance of bean introspection
toCreate - - the class to create

EntityBeanCreator

public EntityBeanCreator(javax.persistence.EntityManager em,
                         EntityBeanIntrospector<T> intro,
                         java.lang.Class<T> toCreate,
                         java.util.List<Generator<?>> additionalGenerators)
Constructor with special generator list.

Parameters:
em - the current entity manager.
intro - - a isntance of bean introspection
toCreate - - the class to create
additionalGenerators - - additional generators
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 clenup method (annotation).


createBeanInstance

public T createBeanInstance()
Creates a instance of the entyty bean (filled with random data) without any persistence operations.

Returns:
-a random instance of the entity bean


Copyright © 2008. All Rights Reserved.