Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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:

 <?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

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

share|improve this question

2 Answers 2

Does the postgres user have permission to the tables in the locatimus schema ?

share|improve this answer
    
Yes, the postgres user has exactly the same permissions on both schemas (usage, create) –  Damian Dec 9 '09 at 10:41
up vote 2 down vote accepted

OK, I found the problem. It seems that the table names must be in lowercase or hibernate tools does not see them. I don't know if this is a bug with the PostgresSQL dialect or Hibernate itself.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.