Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Middlegen Hibernate issue

 
Sagar Bilgi
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Does anyone know how to change the default mapping that middlegen uses while reading database schemas to generate hibernate ( *.hbm.xml) files.

I am using middlegen to connect to a oracle database and middlegen seems to map columns of Float datatype in the database to type Object in the hbm.xml files. Similarly for Oracle column type Number it is converting into Big Decimal.

Can these preferences be changed via a config file or in some other place?
Any help in this will be highly appreciated.
 
Sagar Bilgi
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Figured you can change this by providing your own custom type mapper to the hibernate plug in the Ant task.

something like this..

<hibernate
destination="${build.gen-src.dir}"
package="${name}.hibernate"
javaTypeMapper="mypackage.MyJavaTypeMapper"
/>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic