This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization 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