-->
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: save immutable object
PostPosted: Mon Apr 25, 2005 12:02 am 
Newbie

Joined: Sun Apr 24, 2005 11:24 pm
Posts: 1
Hi.

I have POJO adapters around immutables objects.
It's illegal for this objects to call setXXX method while saving object.
But when I try to save this object with session.save(...) I get calls to setXXX.
Why it is nessesary for hibernate to call setXXX() methods while saving object?


Many thanks.

Hibernate version: 2.1.4 , 3.0.1

Full stack trace of any exception that occurs: Exception occurred inside setter of xxx.XXX
net.sf.hibernate.PropertyAccessException: Exception occurred inside setter of xxx..XXX
at net.sf.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:49)
at net.sf.hibernate.type.ComponentType.setPropertyValues(ComponentType.java:230)
at net.sf.hibernate.impl.WrapVisitor.processComponent(WrapVisitor.java:116)
at net.sf.hibernate.impl.AbstractVisitor.processValue(AbstractVisitor.java:77)
at net.sf.hibernate.impl.WrapVisitor.processValues(WrapVisitor.java:93)
at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:920)
at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:857)
at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:779)
at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:738)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 25, 2005 5:32 pm 
Regular
Regular

Joined: Mon Jul 26, 2004 2:28 pm
Posts: 86
Location: Pensacola, Florida
It calls setXXX for versions, discriminators, and ids, as these are all generated just prior to creating and executing the INSERT statement.

- Jesse


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.