[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
| 
Re: [eclipselink-users] Dyn. Weaving, Lazy Collection, Clone Problem
 | 
Hi Oliver,
  If you want to see what any of your weaved classes do, you can do it with the 
combination of a set of properties and a java decompiler.
  Set the two system properties:
eclipselink.weaving.output.path=<path>
eclipselink.weaving.overwrite.existing=true
  The output of the weaving process will go to <path>.  You should be able to 
decompile those class files.
  Here is a sample _persistence_shallow_clone() from one of our test classes:
    public Object _persistence_shallow_clone()
    {
        return super.clone();
    }
  The main impact of implementing your own clone method is that you take 
responsibility for ensuring everything is cloned.  There may be very minor 
performance impact, but it is likely almost negligible when done for just one class.
-Tom
Oliver Vesper wrote:
Hi Tom,
thanks a lot for your response. I added the following annotation to my 
entity class:
@CopyPolicy(InstantiationCopyPolicy.class)
I can see that the databinding is working as expected, so my 
PropertyChangeSupport instance seems to refer to the right entity, which 
was the error I saw before. I haven't debugged the code yet to verify 
everything is really working as expected, but at the first glance it 
looks good.
Do you know what the weaved _persistence_shallow_clone() method does? I 
haven't been able to debug into that one, I guess I must have a look at 
the eclipselink-weaving-bundles' code. I wonder if not using the default 
(when weaving is used) copy policy (PersistenceEntityCopyPolicy) has any 
negative impact?
-Oliver
Hi Olivier,
  Take a look at this link for copy policy configuration:
http://wiki.eclipse.org/Using_EclipseLink_JPA_Extensions_%28ELUG%29#Using_EclipseLink_JPA_Extensions_for_Copy_Policy 
  You should be able to defined a CloneCopyPolicy that will use a 
method of your choice to do the cloning.
-Tom
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users