-->
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: HibernateException - Wrong column type
PostPosted: Fri May 25, 2007 4:10 pm 
Newbie

Joined: Fri May 25, 2007 3:58 pm
Posts: 10
I'm getting the following error when deploying my code. I think it is a problem with the mapping, but I don't know what's wrong with it. I've included my mapping file, database create so you know how the table was created, a domain object snipet, and the Hibernate properties I have set. I'm using xdoclet2 to create the mapping file. I'm running this on Weblogic 8.1.6, Windows XP (development environment), DB2 8.x, Spring 2.0.5, and Hibernate 3.2.3.ga. I've tried this while using double and Double as the types in the domain object, and I get the same error, except "numeric(6,2)" was replaced with "double". Any ideas what I've done wrong?


error
org.hibernate.HibernateException: Wrong column type: RATE, expected: numeric(6,2)
at org.hibernate.mapping.Table.validateColumns(Table.java:251)
at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1007)
at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:116)


mapping
<hibernate-mapping>
<class table="PROJECT_FINANCE_RATE_EMPLOYEE" name="com...FinanceRateEmployee">
<composite-id unsaved-value="none" name="financeRateEmployeeID" class="com...FinanceRateEmployeeID">
<key-property name="costCenter" column="COST_CENTER"/>
<key-property name="effectiveDate" column="EFFECTIVE_DATE" type="date"/>
<key-property name="eptRole" column="EPT_ROLE_ID" type="integer"/>
<key-property name="orgId" column="ORG_ID"/>
</composite-id>
<property name="createdAt" column="CREATED_AT" type="timestamp"/>
<property name="createdBy" column="CREATED_BY"/>
<property name="lastChangedAt" column="LAST_CHANGED_AT" type="timestamp"/>
<property name="lastChangedBy" column="LAST_CHANGED_BY"/>
<property name="rate" scale="2" column="RATE" precision="6" type="big_decimal"/>
</class>
</hibernate-mapping>


database create statement for the table
CREATE TABLE "EPTOWNER"."PROJECT_FINANCE_RATE_EMPLOYEE"
("ORG_ID" VARCHAR(10) NOT NULL,
"COST_CENTER" VARCHAR(10) NOT NULL,
"EPT_ROLE_ID" INTEGER NOT NULL,
"EFFECTIVE_DATE" DATE NOT NULL,
"RATE" DECIMAL(6, 2) NOT NULL,
"CREATED_BY" VARCHAR(8) NOT NULL,
"CREATED_AT" TIMESTAMP NOT NULL DEFAULT CURRENT TIMESTAMP,
"LAST_CHANGED_BY" VARCHAR(8) NOT NULL,
"LAST_CHANGED_AT" TIMESTAMP NOT NULL DEFAULT CURRENT TIMESTAMP
)


domain object snipet
private BigDecimal rate;
/**
* @hibernate.property column="RATE"
* type="big_decimal"
* precision="6"
* scale="2"
* @return rate
*/
public BigDecimal getRate() {
return rate;
}
public void setRate(BigDecimal rate) {
this.rate = rate;
}


hibernate Properties I have set
<prop key="hibernate.dialect">org.hibernate.dialect.DB2Dialect</prop>
<prop key="hibernate.hbm2ddl.auto">validate</prop>
<prop key="hibernate.show_sql">true</prop>


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 29, 2007 2:56 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
you'd better try on the regular user forum

_________________
Emmanuel


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.