Copy « POJO « JPA Q&A





1. Writing a Generic POJO Copy Method    forum.hibernate.org

I've attempted to write a method to copy the non-collection fields of a proxy POJO to another, as defined by the mapping. To do this, I use Property.getGetter() on the field mapping and then apply that getter to obtain the original value, the apply an obtained setter to set the value in the target POJO. This seems to work except for ...

2. How to copy a POJO in a DTO    forum.hibernate.org

Hi all, who knows how can we do for copying a POJO in a DTO. I am working with web services too. In my DTO i can't use java object like Set. So i am using arrays instead of Set. public class MyPojo { //all private variables here Set foo = new HashSet(); //all the puiblic get/set methods here } public ...

3. Cache is holding the old copy of the POJO    forum.hibernate.org

I am encountering a problem where my updated record will be reverted back to previous copy of the record. Following is the senario: 1. I added about 10 records and the field "requestDate" in the 10 records has set to "null". 2. Recall any of the 10 records and set the "requestDate" to the current system date. 3. Verify in SQL ...