Hibernate: Data Object with a dynamic table name by Annotations

后端 未结 6 854
抹茶落季
抹茶落季 2020-12-09 13:06

I have a Data Class for Hibernate associated to a table; imagine the Entity Person like this:

 @Entity
 @org.hibernate.annotations.Proxy(lazy=false)         


        
6条回答
  •  [愿得一人]
    2020-12-09 13:19

    In Hibernate you map 1 class to 1 table. You can not reuse the same Entity to map several tables dynamically.

    Hibernate Envers is a quite good solution for Historic data, but you still will not be able to do what you try (dynamically grow the number of tables without touching mapper Entities).

提交回复
热议问题