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.  [ 2 posts ] 
Author Message
 Post subject: onFlushDirty event has one more property
PostPosted: Mon Nov 28, 2011 5:31 am 
Newbie

Joined: Thu Aug 28, 2008 6:00 am
Posts: 6
Hello, in the onFlushDirty event, in the propertyNames parameter I find a property that it's not mapped in my entity: is a ManyToOne referenced with referencedColumnName, and it has the full entity name (with namespace) in it.

Example:

Entity A:
Other properties here...

Entity B:
@ManyToOne @JoinColumn(name = "B_COLUMN", referencedColumnName="A_OTHER_COLUMN") A a;

While onFlushDirty on A is called, I found something like B_A property, but there is no such property in A.

Is it the correct behaviour? If yes, why?

Thank you.


Top
 Profile  
 
 Post subject: Re: onFlushDirty event has one more property
PostPosted: Mon Nov 28, 2011 6:11 am 
Newbie

Joined: Thu Aug 28, 2008 6:00 am
Posts: 6
After some debugging, I found out that those are called "Synthetic Properties", and they are generated during the second phase of annotation mapping. Plus, they "should" always begin with an underscore (_).

In my use case, I can just skip the properties beginning with the underscore (I'm simply copying my properties into a new object, and I don't think those should be copied anyway).

Is my theory correct?


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

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.