• 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"
/>
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!