Hibernate version:2.1.7c
Name and version of the database you are using:Oracle10g
Mapping documents:
Code:
<?xml version="1.0" encoding="EUC-JP"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping default-cascade="all" package="jp.co.test">
<class name="Test" table="test" dynamic-update="true"
optimistic-lock="version">
<cache usage="read-write"/>
<id name="piid" type="long" column="piid">
<generator class="native"/>
</id>
<version name="version" column="version"/>
<property name="modificationDate" type="timestamp"
column="modification_date"/>
<property name="price" type="big_decimal" column="price"/>
</class>
</hibernate-mapping>
following is hibernate.properties
Code:
hibernate.dialect net.sf.hibernate.dialect.Oracle9Dialect
hibernate.connection.driver_class oracle.jdbc.driver.OracleDriver
hibernate.connection.username test
hibernate.connection.password test
hibernate.connection.url jdbc:oracle:thin:@azteca:1521:bildb
When a big_decimal type is specified in a mapping file and hbm2ddl command is executed, the error of ORA-01728 will occur.
The cause of an error is because big_decimal is changed into NUMBER(19,255).
following is DDL which created by hbm2ddl
Code:
drop table test cascade constraints
drop sequence hibernate_sequence
create table test (
piid number(19,0) not null,
version number(10,0) not null,
modification_date date,
price number(19, 255),
primary key (piid)
)
create sequence hibernate_sequence
Is this a bug?
As management,At first I perform hbm2ddl with options(--text --format),
next,I am performing, after changing NUMBER (19,255) in created SQL into NUMBER.
Is it OK even if a big_decimal type is matched with a NUMBER type?
The following is the command executed when sql was created.
Code:
hbm2ddl --text --format test.hbm.xml > test.sql
Is this problem solved in the following version?