I\'m developing an application using JPA with Hibernate and Postgresql. Using Netbeans wizard, I created entity classes from the existing database. The extract from one of t
Postgres (used to, not sure on the newer) convert table names to lower case. That's the preferred operating procedure. If you log your queries you'll see hibernate may be or may not be quoting your table name (I'd guess it isn't).
Hibernate saving User model to Postgres
Honestly, if you're running on Postgres you really should either configure hibernate properly, or, as I would look at it, normalize your database as tables shouldn't have a namespace collision (thus removing the problem).
//From the article...
@Entity
@Table(name="\"User\"")
public class User {
...
}
EDITED 07/31/12:
This change must be done to the fields of the tables in the following way:
For @Column
, change the name of the column adding escaped ":
@Column(name = "\"C_MODEL\"")
For @JoinColumn
, change the name of the column adding `:
@JoinColumn(name = "`TP_MODEL`")
You will have to do it manually on the columns giving you errors.