Class PopulationManager
java.lang.Object
org.eclipse.persistence.tools.schemaframework.PopulationManager
Purpose: This class is used to populate example data into the database, it allows for circular references to be resolved.
Responsibilities:
- Allow objects to be registered.
- Allow objects to be looked up.
- Store a globally accessible default instance.
-
Field Summary
Modifier and TypeFieldDescriptionprotected static PopulationManager
Store the default instance.protected Hashtable
Store the objects registered. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAllObjectsForAbstractClass
(Class objectsClass, org.eclipse.persistence.internal.sessions.AbstractSession session, Vector allObjects) Add all of the objects of the class and all of its subclasses.void
addAllObjectsForAbstractClass
(Class objectsClass, Session session, Vector allObjects) Add all of the objects of the class and all of its subclasses.void
addAllObjectsForClass
(Class objectsClass, List allObjects) Add all of the objects of the class.boolean
containsObject
(Class objectsClass, String objectsName) Check if the object is registered given its name.boolean
containsObject
(Object objectToCheck, String objectsName) Check if the object is registered given its name.Return all of the objects registered.Return all of the objects registered.getAllObjectsForAbstractClass
(Class objectsClass) Return all of the objects of the class and all of its subclasses.getAllObjectsForAbstractClass
(Class objectsClass, org.eclipse.persistence.internal.sessions.AbstractSession session) Return all of the objects of the class and all of its subclasses.getAllObjectsForClass
(Class objectsClass) Return all of the objects of the class.static PopulationManager
Lazy initialize the default instance.Return the object registered given its name.Return the registered objects.registerObject
(Class javaClass, Object objectToRegister, String objectsName) Register the object given its name.registerObject
(Object objectToRegister, String objectsName) Register the object given its name.void
removeObject
(Class classToRemove, String objectsName) Remove the object given its class and name.removeObject
(Object objectToRemove, String objectsName) Remove the object given its name.static void
Reset the default instance.static void
setDefaultManager
(PopulationManager theDefaultManager) Set the default instance.void
setRegisteredObjects
(Hashtable registeredObjects) Set the registered objects.
-
Field Details
-
registeredObjects
Store the objects registered. -
defaultManager
Store the default instance.
-
-
Constructor Details
-
PopulationManager
public PopulationManager()
-
-
Method Details
-
addAllObjectsForAbstractClass
public void addAllObjectsForAbstractClass(Class objectsClass, org.eclipse.persistence.internal.sessions.AbstractSession session, Vector allObjects) Add all of the objects of the class and all of its subclasses. The session is needed because there is no other way to find all subclasses. -
addAllObjectsForAbstractClass
Add all of the objects of the class and all of its subclasses. The session is needed because there is no other way to find all subclasses. -
addAllObjectsForClass
Add all of the objects of the class. -
containsObject
Check if the object is registered given its name. -
containsObject
Check if the object is registered given its name. -
getAllClasses
Return all of the objects registered. -
getAllObjects
Return all of the objects registered. -
getAllObjectsForAbstractClass
Return all of the objects of the class and all of its subclasses. -
getAllObjectsForAbstractClass
public Vector getAllObjectsForAbstractClass(Class objectsClass, org.eclipse.persistence.internal.sessions.AbstractSession session) Return all of the objects of the class and all of its subclasses. The session is needed because there is no other way to find all subclasses. -
getAllObjectsForClass
Return all of the objects of the class. -
getDefaultManager
Lazy initialize the default instance. -
getObject
Return the object registered given its name. -
getRegisteredObjects
Return the registered objects. -
registerObject
Register the object given its name. The objects are represented as a hashtable of hashtables, lazy initialized on the class. -
registerObject
Register the object given its name. The objects are represented as a hashtable of hashtables, lazy initialized on the class. -
removeObject
Remove the object given its class and name. -
removeObject
Remove the object given its name. -
resetDefaultManager
public static void resetDefaultManager()Reset the default instance. -
setDefaultManager
Set the default instance. -
setRegisteredObjects
Set the registered objects.
-