org.eclipse.persistence.sessions.ObjectCopyingPolicy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of eclipselink Show documentation
Show all versions of eclipselink Show documentation
EclipseLink build based upon Git transaction f2b9fc5
/*
* Copyright (c) 1998, 2018 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.sessions;
import java.util.*;
/**
* Purpose: Define how an object is to be copied.
* Description: This is for usage with the object copying feature, not the unit of work.
* This is useful for copying an entire object graph as part of the
* host application's logic.
* Responsibilities:
* - Indicate through CASCADE levels the depth relationships will copied.
*
- Indicate if PK attributes should be copied with existing value or should be reset.
*
* @since TOPLink/Java 3.0
* @see Session#copyObject(Object, ObjectCopyingPolicy)
* @deprecated use CopyGroup instead.
*/
public class ObjectCopyingPolicy extends CopyGroup {
/**
* PUBLIC:
* Return a new copying policy.
* By default the policy cascades privately owned parts and nulls primary keys.
*/
public ObjectCopyingPolicy() {
super();
this.shouldResetPrimaryKey = true;
// 2612538 - the default size of Map (32) is appropriate
this.copies = new IdentityHashMap();
this.depth = CASCADE_PRIVATE_PARTS;
}
}