开发者

Can I create many tables according to the same entity?

开发者 https://www.devze.com 2022-12-29 17:26 出处:网络
What I want to do is that I want to make the many tables dynamically which are the same entity structures. And then I want to refer to the dynamically created ta开发者_StackOverflowbles according to t

What I want to do is that I want to make the many tables dynamically which are the same entity structures. And then I want to refer to the dynamically created ta开发者_StackOverflowbles according to the table name. What I understood from hibernate reference is that I can only create only one table and it should be matched exactly with entity. So I can't find any solution to my problem.

If you know any relevent open source related to my problem or any tip or web site, let me know.


Does it need to be separate tables? Maybe you can add a field called EntityTypeID that is a foreign key to one other table that describes the type for that record? Then you can query the objects separately?


you can use entity-name in order to map the same entity to different tables.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号