Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
LenGrant
Post subject: Trouble reverse engineering Postgres database tables  PostPosted: Jul 10, 2008 - 10:01 PM



Joined: Jul 10, 2008
Posts: 1

I'm attempting to reverse engineer a large amount of tables using the Hibernate Reverse Engineering process, but every time I do, the fields that are boolean in my database are converted to Byte types in the classes that are generated.

Is there a way to prevent this from happening?
 
 View user's profile Send private message  
Reply with quote Back to top
support-nipun
Post subject: RE: Trouble reverse engineering Postgres database tables  PostPosted: Jul 11, 2008 - 03:23 PM
Registered Member
Registered Member


Joined: Apr 18, 2007
Posts: 5657

On the second page of the Hibernate Reverse Engineering wizard, you can specify the custom mapping. There you will have to map the boolean to Byte type there.

_________________
Nipun
MyEclipse Support
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
mschirmer
Post subject:   PostPosted: Aug 08, 2008 - 01:41 PM



Joined: Aug 08, 2008
Posts: 1

we have the same problem with our postgre database and the hibernate reverse engineering tool. booleans in the database are converted to byte and bytea[] (binary data) is converted to string by the tools.

Can you give me a detailed description on how to define customized mappings on page 2 of the wizard?

thanks
 
 View user's profile Send private message  
Reply with quote Back to top
support-nipun
Post subject:   PostPosted: Aug 18, 2008 - 09:03 PM
Registered Member
Registered Member


Joined: Apr 18, 2007
Posts: 5657

On the second page, there is a Customized Type Mappings table. First, you need to click the Add button. Next, click on the JDBC Type cell and enter the JDBC type (VARCHAR, CHAR etc) that you want to map. Click on thHibernate type and enter the Java type that the JDBC type should match to.

Hit Finish and that should take care of the rest.

Here is a table that you can refer to go get an idea on what Java Types the JDBC types should map to.
http://db.apache.org/ojb/docu/guides/jdbc-types.html

_________________
Nipun
MyEclipse Support
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
kbowen42
Post subject:   PostPosted: Oct 03, 2008 - 09:06 PM



Joined: Sep 05, 2008
Posts: 2

The specific mapping that works to make postgress BOOLEAN map into java boolean is to map JDBC BIT to java boolean on p.2 of the JPA mapping wizard.
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits