• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Middlegen Hibernate issue  RSS feed

 
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"
/>
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!