0

Is it possible to create a schema in postgresql using hibernate? I mean, in a function I pass like a parameter the String name of the schema, and with native sql i try to create the schema automatically in postgresql, i refresh the schemas but I havent succeed.

I was searching and it seems like nobody has tried it.

is it possible?

Thanks.

nitind
  • 19,089
  • 4
  • 34
  • 43
Gabriela Rdz
  • 15
  • 1
  • 5
  • i do not think so. Typically that is the job of startup scripts. Hibernate is for querying and persisting the data. Its not a tool to manage schema. I am saying this based on my experience/understanding of hibernate. I could be wrong but I have never come across use case where you try to create schema using hibernate. In short you have not found anyone doing so because hibernate is not meant to do so. – Acewin Aug 07 '17 at 22:15
  • 1
    Possible duplicate of [Hibernate hbm2ddl.auto possible values and what they do?](https://stackoverflow.com/questions/438146/hibernate-hbm2ddl-auto-possible-values-and-what-they-do) – Brian Aug 07 '17 at 22:22
  • Thanks, What i wanted to do was to create schemas with a function and this schemas automatically refresh in postgresql, but for what i've been reading is not possible with hibernate, so just to be clear hibernate its just for persistance. – Gabriela Rdz Aug 07 '17 at 22:55

0 Answers0