Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » Cloning a record in Database using CopyGroup(Need to clone a row and update corresponding dependencies in Child tables only(OneToMany))
Cloning a record in Database using CopyGroup [message #1496636] Wed, 03 December 2014 01:28
Eclipse UserFriend
Hi,
I am trying to clone a record using CopyGroup with the following parameters and code.

CopyGroup copyGroup = new CopyGroup();
copyGroup.setShouldResetPrimaryKey(true);
ServiceClass serviceNew = (ServiceClass ) em.unwrap(JpaEntityManager.class).copy(service , copyGroup);

my FetchType is FetchType.LAZY
I am using generator @GeneratedValue(strategy = GenerationType.SEQUENCE,generator = "TASKS") for generating new primaryKey while cloning

It is copying the record only for the Service table , I want to acheive new rows to be created in the child (Foreign key dependent) tables with their actual data corresponding to the given Service table PrimaryKey. How to acheive this ??
Previous Topic:min and max (aggregate) don't appear in SQL request
Next Topic:Memory leak issue
Goto Forum:
  


Current Time: Fri Jul 04 20:38:33 EDT 2025

Powered by FUDForum. Page generated in 0.02618 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top