Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (c) 1998, 2024 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0,
* or the Eclipse Distribution License v. 1.0 which is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
*/
// Contributors:
// Oracle - initial API and implementation from Oracle TopLink
package org.eclipse.persistence.tools.schemaframework;
import org.eclipse.persistence.descriptors.ClassDescriptor;
import org.eclipse.persistence.internal.sessions.AbstractSession;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;
import java.util.Vector;
/**
*
* 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.
*
*/
public class PopulationManager {
/** Store the objects registered. */
protected Map, Map> registeredObjects;
/** Store the default instance. */
protected static PopulationManager defaultManager;
public PopulationManager() {
registeredObjects = new Hashtable<>();
}
/**
* Add all the objects of the class and all of its subclasses.
* The session is needed because there is no other way to find all subclasses.
*/
public void addAllObjectsForAbstractClass(Class objectsClass, AbstractSession session, Vector