动态制作同一实体的多个表

时间:2019-05-31 16:24:52

标签: java hibernate jpa

我正在尝试从Java实体中生成多个表,问题是我需要动态生成它们。表格编号为table_tenantId

因此,如果我有多个租户,则每个租户都需要有一张桌子。因此,如果我的申请中有3个租户,我将拥有:

table_1
table_2
table_3

但是如果我有4个租户,我将需要拥有:

table_4

我已经看到JPA, How to use the same class (entity) to map different tables?

但是我需要自己生成一个类。

有没有一种方法可以动态生成它们?

//////////////更新//////////////

列:

private Long id;

private String filing_date; 

private String index_date;

private String filing_id_number;

private Byte state;

private Long documentalTypeInstance_id;

private Long documentalstructureinstance_id;

private Long parent_id;

private Long physicallocation_id;

private Long user_id;

private Long formdocument_id;

private String token_id;

private Boolean is_loaned;    

谢谢!

0 个答案:

没有答案