-->
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.  [ 4 posts ] 
Author Message
 Post subject: formula attribute in hbm
PostPosted: Sat Jul 21, 2007 5:13 am 
Newbie

Joined: Thu Jun 21, 2007 6:44 am
Posts: 9
Location: chennai
I used this attribute in my program but no reaction in table .
but it excuate without exception and error

for Eg
<property name='total' formula="mark1+mark2" />


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 21, 2007 11:12 am 
Hibernate Team
Hibernate Team

Joined: Tue Jun 13, 2006 11:29 pm
Posts: 315
Location: Calgary, Alberta, Canada
A property that is mapped to a formula is read-only.

_________________
Karl Chu


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 24, 2007 6:48 am 
Newbie

Joined: Thu Jun 21, 2007 6:44 am
Posts: 9
Location: chennai
that colum is not in my table

how can i solve this..

please explain briefly..

i am new biginner in hibernate.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 24, 2007 10:17 am 
Hibernate Team
Hibernate Team

Joined: Tue Jun 13, 2006 11:29 pm
Posts: 315
Location: Calgary, Alberta, Canada
For example, you mapped a property "LineTotal" to be "Quantity * ItemPrice". When NHibernate does a select it does this:
Code:
SELECT Quantity * ItemPrice AS LineTotal FROM ...

What do you suppose NHibernate should write back to the database when you do a save? Therefore, property mapped with a formula is read-only. Hope this clear things up.

_________________
Karl Chu


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.