-->
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: Formula attribute in property giving an error.
PostPosted: Tue Jun 14, 2005 5:15 am 
Newbie

Joined: Wed Jun 08, 2005 5:33 am
Posts: 2
Hi,

My project is using springframework & hibernate.

In one of the mapping files, i have a requirement of a field in xml, which should not be mapped with any column of database but should be the sum of four columns of database. the code is as follows

<property name="total" formula="(select QUARTER_1 + QUARTER_2 + QUARTER_3 + QUARTER_4 from epr_finance f where f.promotion_id = PROMOTION_ID and f.attribute_id = ATTRIBUTE_ID)" type="double">

<meta attribute="property-type">java.lang.Double</meta>

</property>

I m getting the following error::

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Initialization of bean failed; nested exception is net.sf.hibernate.MappingException: properties of components may not be formulas: total
net.sf.hibernate.MappingException: properties of components may not be formulas: total
at net.sf.hibernate.cfg.Binder.bindComponent(Binder.java:882)

How can i resolve this ??


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.