-->
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 use formula?
PostPosted: Mon Sep 26, 2005 9:21 am 
Newbie

Joined: Wed Sep 07, 2005 12:02 am
Posts: 7
How to use formula?
I use the attribute 'formula' to subselect the numbers of all rows in the 'property' tag, it runs smoothly.
I also want to sum some two colomns values, but I don't know how to write the expression. The following is the mapping I

wrote and the exception:

Caused by: java.sql.SQLException: Unknown column 'jobs0_.minLvl' in 'field list'
<?xml version="1.0" encoding='UTF-8'?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >

<!-- DO NOT EDIT: This is a generated file that is synchronized -->
<!-- by MyEclipse Hibernate tool integration. -->
<!-- Created Thu Sep 22 15:24:37 CST 2005 -->
<hibernate-mapping package="com.test">

<class name="Jobs" table="jobs">
<id name="jobId" column="job_id" type="short">
<generator class="increment" />
</id>

<property name="jobDesc" column="job_desc" type="string"
not-null="true" />
<property name="minLvl" column="min_lvl" type="short"
not-null="true" />
<property name="maxLvl" column="max_lvl" type="short"
not-null="true" />
<property name="twovalues" type="short"
formula="( minLvl+maxLvl )" />
<!--
formula="( select COUNT(*) from Jobs )" />
--> <bag name="employeeSet" cascade="all" inverse="true">
<key column="job_id" />
<one-to-many class="Employee" />
</bag>
</class>

</hibernate-mapping>


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.