-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 posts ] 
Author Message
 Post subject: No output when reverse engineering pojos from Postgres
PostPosted: Tue Dec 08, 2009 7:29 am 
Newbie

Joined: Tue Dec 08, 2009 7:00 am
Posts: 6
Hi - I am trying to reverse engineer pojos (using hibernate tools plugin v3.2.4x in eclipse 3.4.2) from a database that I have created in Postgres but my tables are being ignored. It works if I specify 'public' as the value for the 'hibernate.default_schema' property in my hibernate.cfg.xml file but if I try to specify a different schema then nothing is generated.

I've tried modifying the case (i.e. lower, upper, camel) but I still get the same result. Here is my hibernate.cfg.xml file:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
      "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
      "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory name="MyFactory">
        <property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
        <property name="hibernate.connection.password">[mypassword]</property>
        <property name="hibernate.connection.url">jdbc:postgresql://localhost:5432/testgis</property>
        <property name="hibernate.connection.username">postgres</property>
        <property name="hibernate.default_schema">locatimus</property>
        <property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
    </session-factory>
</hibernate-configuration>


Here is a picture of my setup in pgAdmin III - http://twitpic.com/snj8i

and my hibernate code generation config in eclipse
1) http://twitpic.com/snjhs
2) http://twitpic.com/snjlk

I modified the log4j properties so that I could get some debug messages in eclipse:
Code:
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - putInContext exporter=org.hibernate.tool.hbm2x.POJOExporter@1c75315
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - putInContext c2h=org.hibernate.tool.hbm2x.Cfg2HbmTool@11fc108
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - putInContext c2j=org.hibernate.tool.hbm2x.Cfg2JavaTool@1b9f7df
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - putInContext outputdir=C:\Documents and Settings\Damian\workspace\TestLocatmiusHib\src
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - putInContext template_path=[Ljava.lang.String;@406d07
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - putInContext ejb3=true
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - putInContext jdk5=true
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - putInContext artifacts=org.hibernate.tool.hbm2x.ArtifactCollector@1b60992
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - putInContext cfg=org.hibernate.cfg.JDBCMetaDataConfiguration@2e825b
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - removeFromContext ejb3=true
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - removeFromContext jdk5=true
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - removeFromContext outputdir=C:\Documents and Settings\Damian\workspace\TestLocatmiusHib\src
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - removeFromContext template_path=[Ljava.lang.String;@406d07
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - removeFromContext exporter=org.hibernate.tool.hbm2x.POJOExporter@1c75315
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - removeFromContext artifacts=org.hibernate.tool.hbm2x.ArtifactCollector@1b60992
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - removeFromContext cfg=org.hibernate.cfg.JDBCMetaDataConfiguration@2e825b
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - removeFromContext c2h=org.hibernate.tool.hbm2x.Cfg2HbmTool@11fc108
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - removeFromContext c2j=org.hibernate.tool.hbm2x.Cfg2JavaTool@1b9f7df
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - putInContext exporter=org.hibernate.tool.hbm2x.HibernateMappingExporter@17060fa
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - putInContext c2h=org.hibernate.tool.hbm2x.Cfg2HbmTool@eef224
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - putInContext c2j=org.hibernate.tool.hbm2x.Cfg2JavaTool@15b1afd
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - putInContext outputdir=C:\Documents and Settings\Damian\workspace\TestLocatmiusHib\src
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - putInContext template_path=[Ljava.lang.String;@48e2ff
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - putInContext ejb3=true
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - putInContext jdk5=true
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - putInContext artifacts=org.hibernate.tool.hbm2x.ArtifactCollector@1b60992
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - putInContext cfg=org.hibernate.cfg.JDBCMetaDataConfiguration@2e825b
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - putInContext hmgs=org.hibernate.tool.hbm2x.HibernateMappingGlobalSettings@12edbb3
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - removeFromContext ejb3=true
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - removeFromContext jdk5=true
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - removeFromContext outputdir=C:\Documents and Settings\Damian\workspace\TestLocatmiusHib\src
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - removeFromContext template_path=[Ljava.lang.String;@48e2ff
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - removeFromContext exporter=org.hibernate.tool.hbm2x.HibernateMappingExporter@17060fa
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - removeFromContext artifacts=org.hibernate.tool.hbm2x.ArtifactCollector@1b60992
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - removeFromContext cfg=org.hibernate.cfg.JDBCMetaDataConfiguration@2e825b
2009-12-08 10:56:52,000 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - removeFromContext c2h=org.hibernate.tool.hbm2x.Cfg2HbmTool@eef224
2009-12-08 10:56:52,015 DEBUG Worker-15 org.hibernate.tool.hbm2x.TemplateHelper - removeFromContext c2j=org.hibernate.tool.hbm2x.Cfg2JavaTool@15b1afd


I'm pretty sure that I'm doing (or missing) something easy. As I say, if I change the schema to public then pojos from all tables in that schema are generated!

Can anyone help?

Many thanks,
Damian


Top
 Profile  
 
 Post subject: Re: No output when reverse engineering pojos from Postgres
PostPosted: Thu Dec 10, 2009 6:16 am 
Newbie

Joined: Tue Dec 08, 2009 7:00 am
Posts: 6
OK, well I still haven't found a solution to this yet so in order to make some progres I have created my tables in the public schema. However, now it seems that hibernate is somehow using a cached version of that schema and so generates pojos for the original tables in the public schema but ignores my new tables!

Arrgghhhh! (cached copy not yet stale; using cached.)

How can I tell hibernate to ignore its cache?
N.B. I have tried setting hibernate.cache.use_query_cache to false. Debug output below:

Thanks,
Damian

[code]2009-12-10 10:14:08,812 DEBUG Worker-14 org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy - Default type found for [events.event_id t:BIGINT l:255 p:19 s:2 n:false id:false] to [long]
2009-12-10 10:14:08,812 DEBUG Worker-14 org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy - Default type found for [events.event_date t:TIMESTAMP l:29 p:19 s:2 n:true id:false] to [timestamp]
2009-12-10 10:14:08,812 DEBUG Worker-14 org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy - Default type found for [events.title t:VARCHAR l:255 p:19 s:2 n:true id:false] to [string]
2009-12-10 10:14:08,812 DEBUG Worker-14 org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy - No default type found for [events.loc t:OTHER l:255 p:19 s:2 n:true id:false] falling back to [serializable]
2009-12-10 10:14:08,812 DEBUG Worker-14 org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy - Default type found for [geometry_columns.f_table_catalog t:VARCHAR l:256 p:19 s:2 n:false id:false] to [string]
2009-12-10 10:14:08,812 DEBUG Worker-14 org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy - Default type found for [geometry_columns.f_table_schema t:VARCHAR l:256 p:19 s:2 n:false id:false] to [string]
2009-12-10 10:14:08,812 DEBUG Worker-14 org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy - Default type found for [geometry_columns.f_table_name t:VARCHAR l:256 p:19 s:2 n:false id:false] to [string]
2009-12-10 10:14:08,812 DEBUG Worker-14 org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy - Default type found for [geometry_columns.f_geometry_column t:VARCHAR l:256 p:19 s:2 n:false id:false] to [string]
2009-12-10 10:14:08,812 DEBUG Worker-14 org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy - Default type found for [geometry_columns.coord_dimension t:INTEGER l:255 p:19 s:2 n:false id:false] to [int]
2009-12-10 10:14:08,812 DEBUG Worker-14 org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy - Default type found for [geometry_columns.srid t:INTEGER l:255 p:19 s:2 n:false id:false] to [int]
2009-12-10 10:14:08,812 DEBUG Worker-14 org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy - Default type found for [geometry_columns.type t:VARCHAR l:30 p:19 s:2 n:false id:false] to [string]
2009-12-10 10:14:08,812 DEBUG Worker-14 org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy - Default type found for [gtest.id t:INTEGER l:255 p:19 s:2 n:true id:false] to [java.lang.Integer]
2009-12-10 10:14:08,812 DEBUG Worker-14 org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy - Default type found for [gtest.name t:VARCHAR l:20 p:19 s:2 n:true id:false] to [string]
2009-12-10 10:14:08,812 DEBUG Worker-14 org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy - No default type found for [gtest.geom t:OTHER l:255 p:19 s:2 n:true id:false] falling back to [serializable]
2009-12-10 10:14:08,812 DEBUG Worker-14 org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy - Default type found for [spatial_ref_sys.srid t:INTEGER l:255 p:19 s:2 n:false id:false] to [int]
2009-12-10 10:14:08,812 DEBUG Worker-14 org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy - Default type found for [spatial_ref_sys.auth_name t:VARCHAR l:256 p:19 s:2 n:true id:false] to [string]
2009-12-10 10:14:08,812 DEBUG Worker-14 org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy - Default type found for [spatial_ref_sys.auth_srid t:INTEGER l:255 p:19 s:2 n:true id:false] to [java.lang.Integer]
2009-12-10 10:14:08,812 DEBUG Worker-14 org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy - Default type found for [spatial_ref_sys.srtext t:VARCHAR l:2048 p:19 s:2 n:true id:false] to [string]
2009-12-10 10:14:08,812 DEBUG Worker-14 org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy - Default type found for [spatial_ref_sys.proj4text t:VARCHAR l:2048 p:19 s:2 n:true id:false] to [string]
2009-12-10 10:14:08,812 DEBUG Worker-14 freemarker.cache - Could not find template in cache, creating new one; id=[pojo/Pojo.ftl[en_GB,Cp1252,parsed] ]
2009-12-10 10:14:08,812 DEBUG Worker-14 freemarker.cache - Compiling FreeMarker template pojo/Pojo.ftl[en_GB,Cp1252,parsed] from bundleresource://871.fwk22522451:19/pojo/Pojo.ftl
2009-12-10 10:14:08,828 DEBUG Worker-14 freemarker.cache - Could not find template in cache, creating new one; id=[pojo/PojoTypeDeclaration.ftl[en_GB,Cp1252,parsed] ]
2009-12-10 10:14:08,828 DEBUG Worker-14 freemarker.cache - Compiling FreeMarker template pojo/PojoTypeDeclaration.ftl[en_GB,Cp1252,parsed] from bundleresource://871.fwk22522451:19/poj ... ration.ftl
2009-12-10 10:14:08,828 DEBUG Worker-14 freemarker.cache - Could not find template in cache, creating new one; id=[pojo/Ejb3TypeDeclaration.ftl[en_GB,Cp1252,parsed] ]
2009-12-10 10:14:08,828 DEBUG Worker-14 freemarker.cache - Compiling FreeMarker template pojo/Ejb3TypeDeclaration.ftl[en_GB,Cp1252,parsed] from bundleresource://871.fwk22522451:19/poj ... ration.ftl
2009-12-10 10:14:08,828 DEBUG Worker-14 freemarker.cache - Could not find template in cache, creating new one; id=[pojo/PojoFields.ftl[en_GB,Cp1252,parsed] ]
2009-12-10 10:14:08,828 DEBUG Worker-14 freemarker.cache - Compiling FreeMarker template pojo/PojoFields.ftl[en_GB,Cp1252,parsed] from bundleresource://871.fwk22522451:19/pojo/PojoFields.ftl
2009-12-10 10:14:08,828 DEBUG Worker-14 freemarker.cache - Could not find template in cache, creating new one; id=[pojo/PojoConstructors.ftl[en_GB,Cp1252,parsed] ]
2009-12-10 10:14:08,828 DEBUG Worker-14 freemarker.cache - Compiling FreeMarker template pojo/PojoConstructors.ftl[en_GB,Cp1252,parsed] from bundleresource://871.fwk22522451:19/poj ... uctors.ftl
2009-12-10 10:14:08,828 DEBUG Worker-14 freemarker.cache - Could not find template in cache, creating new one; id=[pojo/PojoPropertyAccessors.ftl[en_GB,Cp1252,parsed] ]
2009-12-10 10:14:08,843 DEBUG Worker-14 freemarker.cache - Compiling FreeMarker template pojo/PojoPropertyAccessors.ftl[en_GB,Cp1252,parsed] from bundleresource://871.fwk22522451:19/poj ... essors.ftl
2009-12-10 10:14:08,843 DEBUG Worker-14 freemarker.cache - Could not find template in cache, creating new one; id=[pojo/GetPropertyAnnotation.ftl[en_GB,Cp1252,parsed] ]
2009-12-10 10:14:08,843 DEBUG Worker-14 freemarker.cache - Compiling FreeMarker template pojo/GetPropertyAnnotation.ftl[en_GB,Cp1252,parsed] from bundleresource://871.fwk22522451:19/poj ... tation.ftl
2009-12-10 10:14:08,843 DEBUG Worker-14 freemarker.cache - Could not find template in cache, creating new one; id=[pojo/Ejb3PropertyGetAnnotation.ftl[en_GB,Cp1252,parsed] ]
2009-12-10 10:14:08,843 DEBUG Worker-14 freemarker.cache - Compiling FreeMarker template pojo/Ejb3PropertyGetAnnotation.ftl[en_GB,Cp1252,parsed] from bundleresource://871.fwk22522451:19/poj ... tation.ftl
2009-12-10 10:14:08,843 DEBUG Worker-14 freemarker.cache - pojo/GetPropertyAnnotation.ftl[en_GB,Cp1252,parsed] cached copy not yet stale; using cached.
2009-12-10 10:14:08,843 DEBUG Worker-14 freemarker.cache - pojo/Ejb3PropertyGetAnnotation.ftl[en_GB,Cp1252,parsed] cached copy not yet stale; using cached.
2009-12-10 10:14:08,843 DEBUG Worker-14 freemarker.cache - pojo/GetPropertyAnnotation.ftl[en_GB,Cp1252,parsed] cached copy not yet stale; using cached.
2009-12-10 10:14:08,843 DEBUG Worker-14 freemarker.cache - pojo/Ejb3PropertyGetAnnotation.ftl[en_GB,Cp1252,parsed] cached copy not yet stale; using cached.
2009-12-10 10:14:08,843 DEBUG Worker-14 freemarker.cache - pojo/GetPropertyAnnotation.ftl[en_GB,Cp1252,parsed] cached copy not yet stale; using cached.
2009-12-10 10:14:08,843 DEBUG Worker-14 freemarker.cache - pojo/Ejb3PropertyGetAnnotation.ftl[en_GB,Cp1252,parsed] cached copy not yet stale; using cached.
2009-12-10 10:14:08,843 DEBUG Worker-14 freemarker.cache - Could not find template in cache, creating new one; id=[pojo/PojoToString.ftl[en_GB,Cp1252,parsed] ]
2009-12-10 10:14:08,843 DEBUG Worker-14 freemarker.cache - Compiling FreeMarker template pojo/PojoToString.ftl[en_GB,Cp1252,parsed] from bundleresource://871.fwk22522451:19/poj ... String.ftl
2009-12-10 10:14:08,843 DEBUG Worker-14 freemarker.cache - Could not find template in cache, creating new one; id=[pojo/PojoEqualsHashcode.ftl[en_GB,Cp1252,parsed] ]
2009-12-10 10:14:08,843 DEBUG Worker-14 freemarker.cache - Compiling FreeMarker template pojo/PojoEqualsHashcode.ftl[en_GB,Cp1252,parsed] from bundleresource://871.fwk22522451:19/poj ... shcode.ftl
2009-12-10 10:14:08,843 DEBUG Worker-14 freemarker.cache - Could not find template in cache, creating new one; id=[pojo/PojoExtraClassCode.ftl[en_GB,Cp1252,parsed] ]
2009-12-10 10:14:08,843 DEBUG Worker-14 freemarker.cache - Compiling FreeMarker template pojo/PojoExtraClassCode.ftl[en_GB,Cp1252,parsed] from bundleresource://871.fwk22522451:19/poj ... ssCode.ftl
2009-12-10 10:14:08,859 DEBUG Worker-14 freemarker.cache - pojo/Pojo.ftl[en_GB,Cp1252,parsed] cached copy not yet stale; using cached.
2009-12-10 10:14:08,859 DEBUG Worker-14 freemarker.cache - pojo/PojoTypeDeclaration.ftl[en_GB,Cp1252,parsed] cached copy not yet stale; using cached.
2009-12-10 10:14:08,859 DEBUG Worker-14 freemarker.cache - pojo/Ejb3TypeDeclaration.ftl[en_GB,Cp1252,parsed] cached copy not yet stale; using cached.
2009-12-10 10:14:08,859 DEBUG Worker-14 freemarker.cache - pojo/PojoFields.ftl[en_GB,Cp1252,parsed] cached copy not yet stale; using cached.
2009-12-10 10:14:08,859 DEBUG Worker-14 freemarker.cache - pojo/PojoConstructors.ftl[en_GB,Cp1252,parsed] cached copy not yet stale; using cached.
2009-12-10 10:14:08,859 DEBUG Worker-14 freemarker.cache - pojo/PojoPropertyAccessors.ftl[en_GB,Cp1252,parsed] cached copy not yet stale; using cached.
2009-12-10 10:14:08,859 DEBUG Worker-14 freemarker.cache - pojo/GetPropertyAnnotation.ftl[en_GB,Cp1252,parsed] cached copy not yet stale; using cached.
2009-12-10 10:14:08,859 DEBUG Worker-14 freemarker.cache - pojo/Ejb3PropertyGetAnnotation.ftl[en_GB,Cp1252,parsed] cached copy not yet stale; using cached.
2009-12-10 10:14:08,859 DEBUG Worker-14 freemarker.cache - pojo/GetPropertyAnnotation.ftl[en_GB,Cp1252,parsed] cached copy not yet stale; using cached.
2009-12-10 10:14:08,859 DEBUG Worker-14 freemarker.cache - pojo/Ejb3PropertyGetAnnotation.ftl[en_GB,Cp1252,parsed] cached copy not yet stale; using cached.
2009-12-10 10:14:08,859 DEBUG Worker-14 freemarker.cache - pojo/GetPropertyAnnotation.ftl[en_GB,Cp1252,parsed] cached copy not yet stale; using cached.
2009-12-10 10:14:08,859 DEBUG Worker-14 freemarker.cache - pojo/Ejb3PropertyGetAnnotation.ftl[en_GB,Cp1252,parsed] cached copy not yet stale; using cached.
etc...
[code]


Top
 Profile  
 
 Post subject: Re: No output when reverse engineering pojos from Postgres
PostPosted: Thu Dec 10, 2009 6:37 am 
Senior
Senior

Joined: Tue Aug 04, 2009 7:45 am
Posts: 124
I have tried to do the same thing and it works.
Build console configuration and go to Database item, open it (with and without schema set). Do you see your schema "locatimus"?


Top
 Profile  
 
 Post subject: Re: No output when reverse engineering pojos from Postgres
PostPosted: Thu Dec 10, 2009 7:55 am 
Newbie

Joined: Tue Dec 08, 2009 7:00 am
Posts: 6
Hi Dmitry,

Thanks for the reply. Yes, if I set the property

Code:
<property name="hibernate.default_schema">locatimus</property>


in my hibernate.cfg.xml and rebuild my console configuration, I can see all the tables for the Locatimus schema as pictured http://twitpic.com/swvj2

If I then run hibernate code generation - nothing is output.

If I change back to using the public schema and rebuild, I see my original tables + new locatimus tables (now that I have created them in the public schema). But if I run the hibernate code generation, only pojos for the original tables in the public schema are generated!

Hope that makes sense.

Damian


Top
 Profile  
 
 Post subject: Re: No output when reverse engineering pojos from Postgres
PostPosted: Thu Dec 10, 2009 8:15 am 
Senior
Senior

Joined: Tue Aug 04, 2009 7:45 am
Posts: 124
Could it be that you use wrong console configuration in your Hibernate Code Generation Configuration? Show me your Hibernate Code Generation Configuration (Main tab) please.


Top
 Profile  
 
 Post subject: Re: No output when reverse engineering pojos from Postgres
PostPosted: Thu Dec 10, 2009 8:52 am 
Newbie

Joined: Tue Dec 08, 2009 7:00 am
Posts: 6
Pretty sure that I'm using the correct one....

Code generation config:
http://twitpic.com/swzm5

and here's my console config:
http://twitpic.com/swzsi

Thanks again for the help.

Damian


Top
 Profile  
 
 Post subject: Re: No output when reverse engineering pojos from Postgres
PostPosted: Thu Dec 10, 2009 9:36 am 
Senior
Senior

Joined: Tue Aug 04, 2009 7:45 am
Posts: 124
Could it be that schema name in DB is not equals schema name in hibernate.cfg.xml? I mean may be you type you scema name in DB with German(any other?) keyboard layout.


Top
 Profile  
 
 Post subject: Re: No output when reverse engineering pojos from Postgres
PostPosted: Thu Dec 10, 2009 10:05 am 
Senior
Senior

Joined: Tue Aug 04, 2009 7:45 am
Posts: 124
Dmitry Geraskov wrote:
Could it be that schema name in DB is not equals schema name in hibernate.cfg.xml? I mean may be you type you scema name in DB with German(any other?) keyboard layout.

Could not be as you see the tables in Console Configuration View :(


Top
 Profile  
 
 Post subject: Re: No output when reverse engineering pojos from Postgres
PostPosted: Thu Dec 10, 2009 10:40 am 
Newbie

Joined: Tue Dec 08, 2009 7:00 am
Posts: 6
This is quite strange. If I (in my code generation config) deselect .java and .hbm.xml exporters and instead select schema documentation (.html) then, despite an IndexOutOfBoundsException that is thrown by Eclipse, it generates the documentation for all of the tables in the locatimus schema.

http://twitpic.com/sxah3

hmmm????


Top
 Profile  
 
 Post subject: Re: No output when reverse engineering pojos from Postgres
PostPosted: Fri Dec 11, 2009 3:56 am 
Senior
Senior

Joined: Tue Aug 04, 2009 7:45 am
Posts: 124
I found the problem. You need to make your tables to have names in lowercase. This is a bug of PostgresSQL dialect or Hibernate.


Top
 Profile  
 
 Post subject: Re: No output when reverse engineering pojos from Postgres
PostPosted: Fri Dec 11, 2009 6:03 am 
Newbie

Joined: Tue Dec 08, 2009 7:00 am
Posts: 6
Dmitry, I just did a quick test and you are indeed correct! Thank you so much for your help!!!!!

"I'm pretty sure that I'm doing (or missing) something easy." <-- I was right ;-)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.