-->
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: How to reproduce this (my)bug, Id mapped in component prop.
PostPosted: Fri Dec 09, 2005 5:25 am 
Newbie

Joined: Tue Dec 06, 2005 7:44 am
Posts: 2
My Friends,

I've a complicated component mapped object to a table.

For example,
<class name="Foo" table="fatfoo">
<id column="sid" type="long" /> <!-- NOTE THAT I havenot specified name -->
<component name="bar" class="Bar" access="field">
<property name="sid" column="sid" type="long" insert="false" update="false" not-null="true" access="field" />
</component>
</class>

Class
Code:
class Foo{
Bar bar;
}

class Bar{
  long sid;  // this is the id mapped
}

if i update it as
Code:
session.update(foo);
it works fine in unit tests,

The problem starts when I run in managed environment with multiple requests, hibernate issues runtime exception stating "The class has no identifier property".

I got the problem and changed my code as
Code:
session.update(foo, new Long(foo.bar.sid));
it works fine.

I'm very curious about this behaviour. Actually i was unable to produce this problem by a test. Is there any way i can reproduce it in a test??

Please explain,

Thanks,


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.