aspose file tools*
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
Author

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.

Example:

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.


SCJA,SCJP,SCWCD,SCBCD,SCEA I
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).

./pope


blog - InfoQ.com
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: http://aspose.com/file-tools
 
subject: hbm2ddl strange behaviour
 
Similar Threads
Bi-directional mapping problems while creating tables on runtime
Setting column size for BLOB using hbm2ddl
Bi-directional mapping problems while creating tables on runtime
some way to resolve this with ant or other tool
hibernate auto generate database indexes