Hibernate Annotation for Entity existing in more than 1 catalog

后端 未结 3 1918
死守一世寂寞
死守一世寂寞 2021-02-06 08:13

I have a Person entity mapped by Hibernate to a database table in a database catalog \"Active\". After a period of time, records in this database table in the \"Active\" catalo

3条回答
  •  野性不改
    2021-02-06 08:52

    To my knowledge, that would be the right way to do it with annotations (you kinda have two tables so you need two entities). Then run a polymorphic query on the Person entity. I find this pretty clean by the way.

    PS: Can you add a pointer on how to do this with mapping files, I'm really curious.

提交回复
热议问题