how to use Hibernate for two different schemas in a single database

前端 未结 5 904
不知归路
不知归路 2020-12-16 23:32

I want to use two different schema in database, each schema has same set of Tables but data differs. How to use hibernate and point to two different schema.I am new to the h

5条回答
  •  悲哀的现实
    2020-12-17 00:22

    From Hibernate 5,use catalog instead of schema to define schema while creating entity class.

    @Table(name="TABLE_NAME", catalog="SCHEMA_NAME")
    

    Through this case, you can handle multiple schemas.

提交回复
热议问题