This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem trying to perform an insert operation in Postgresql with JPA(Hibernate)

 
Anibal Gimenez Canicoba
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
My Application is using Hibernate as JPA implementation provider. When I try to persist a bean using the Entity Manager, I'm having a JDBC ERROR saying that the entity doesn't exist in postgresql. Due I have show_sql on true I saw the following query: "insert into my_entity.....", so I went to pgAdmin and tried to run the same query and had an error, then put the schema name before the entity and it worked. query: "insert into my_schema.my_entity....."

After some googling I found the "default_schema" prameter for the persistence.xml cofiguration file. I tried that without success.
Is there any way to include the scema on the queries?

Thanks!
Anibal
 
Anibal Gimenez Canicoba
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found a solution.

I had to remove the default_schema from my persistence.xml file and generate the model again. Now, the entities are generated on the public schema and the schema specification before the entity ( [my_schema].[my_entity] ) is not needed anymore.

It is not the ideal solution and of course the original question remains open.

Cheers
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic