File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes hbm2ddl strange behaviour Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "hbm2ddl strange behaviour" Watch "hbm2ddl strange behaviour" New topic

hbm2ddl strange behaviour

Wirianto Djunaidi
Ranch Hand

Joined: Mar 20, 2001
Posts: 210

For some datatype (mostly numerics), hbm2ddl seems to ignore length property when declared as <property>'s attribute instead of <column>'s attribute.


For oracle will generate:
[bold]test number(10)[bold]

While it works fine for string data type.

Is that a bug or it supposed to work that way? So far we circumvent it
by declacaring <column> and use sql-type.

Looking forward to Hibernate3, especially filter capability.
[ September 02, 2004: Message edited by: Wirianto Djunaidi ]
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
<property name="test" column="test" type="long" lenght="5"/>

I think, value of type attribute should be same type in database.

Java Developer, Thailand
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
long is corresponding to an SQL BIGINT type which doesn't have length (my 2c).


blog -
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
In my opinion : use "sql-type" attribute is good.
I agree. Here's the link:
subject: hbm2ddl strange behaviour
It's not a secret anymore!