 |
|
 |
 |
|
 |
 |
| Author |
Message |
|
|
Post subject: Trouble reverse engineering Postgres database tables
Posted: 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? |
|
|
| |
|
|
|
 |
|
|
Post subject: RE: Trouble reverse engineering Postgres database tables
Posted: Jul 11, 2008 - 03:23 PM
|
|
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
|
| |
|
|
|
 |
|
|
Post subject:
Posted: 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 |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Aug 18, 2008 - 09:03 PM
|
|
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
|
| |
|
|
|
 |
|
|
Post subject:
Posted: 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. |
|
|
| |
|
|
|
 |
|
|
| |
|
|
 |
|
 |
|
|
|
 |