This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hbm2ddl strange behaviour

 
Wirianto Djunaidi
Ranch Hand
Posts: 210
Ruby Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<property name="test" column="test" type="long" lenght="5"/>


I think, value of type attribute should be same type in database.
 
Alexandru Popescu
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
long is corresponding to an SQL BIGINT type which doesn't have length (my 2c).

./pope
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my opinion : use "sql-type" attribute is good.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic