3

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

2 Answers 2

3

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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

1 Comment

Yes, the postgres user has exactly the same permissions on both schemas (usage, create)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.