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) and DB2 8.x. I've tried this while using double and Double as the types in the domain object, and I get the same error, except "numeric(15,2)" was replaced with "double". Any ideas what I've done wrong?
error org.hibernate.HibernateException: Wrong column type: RATE, expected: numeric(15,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)
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(15, 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 )
I've had our DBA change the data type to NUMERIC, however, with DB2, there is no difference between NUMERIC and DECIMAL. When the table gets created it is still created as DECIMAL. I also had the DBA change the precision to 6 with a scale of 2. So, in the database, the column in question shows as DECIMAL(6,2) currently. I have no changes in functionality after these changes. Also, I tried to set the type as double and Double, before my original post, and I then received the same error, except that instead of "numeric(15,2)" is read as "double". Do you have any other suggestions?
Time is mother nature's way of keeping everything from happening at once. And this is a tiny ad: