-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Using reflection for testing a Value Object Copy Constructor
PostPosted: Wed Sep 03, 2008 10:05 am 
Newbie

Joined: Wed Sep 03, 2008 9:56 am
Posts: 6
Hi there,

I am looking for a solution for the following problem.

I am writing a test for a hibernate mapped value object copy constructor.

Now, as the object is has many ancestors and many data members (Sets, Lists, other Value Objects) I want to make sure that the copy constructor has deep copied them hibernate wise.

This means the following:

The content is copied but the id field for all copied value objects is null (if not we get an update instead of insert).

The way to do it if using reflection to scan the object and its data members recursively taking into account Collection data members, primitives etc.

Does anyone know a framework I can use?

I need a method that gets the POJO, the field name ("id") and the value (null) and returns false if one of the ids is not null.

Thanks a lot guys,

David


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.