-->
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: idbag mapping exception
PostPosted: Thu Mar 08, 2007 5:44 pm 
Newbie

Joined: Thu Apr 27, 2006 12:21 am
Posts: 4
I am trying to map collections of value types by using idbag:

on the bean:
ArrayList images = new ArrayList();

the idbag mapping as:
<idbag name="images" lazy="true" table="Image">
<collection-id type="long" column="imageID">
<generator class="native"/>
</collection-id>
<key column="FK_itemID"/>
<element type="string" column="fileName" not-null="true"/>
</idbag>

When I save the object I get this error:

org.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.ja.collection.entity.item.idbag.Item.setImages
at org.hibernate.tuple.PojoEntityTuplizer.setPropertyValuesWithOptimizer(PojoEntityTuplizer.java:215)
at org.hibernate.tuple.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:185)
.....

Question:
Based on what I learnt from google searches, it is caused by hibernate during trying to set on bean -- I could be wrong.

So in this case, is it caused by hibernate trying to set the generated imageID to the value object? if so, but in this case, the value object is an string.

Thanks!




Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html


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.