Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 06:28
VenkataKrishna Baandla is currently offline VenkataKrishna BaandlaFriend
Messages: 1
Registered: December 2014
Junior Member
I am trying to clone a record using CopyGroup with the following parameters and code.

CopyGroup copyGroup = new CopyGroup();
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: Sun Feb 25 19:01:18 GMT 2024

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

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

Back to the top