I'm trying to generate multiple tables out of a Java entity, the problem is that I need to generate them dynamically. Tables are numbered as table_tenantId
So, if I have multiple tenants I need to have a table per tenant. So If I have 3
tenants on my application I'll have:
table_1
table_2
table_3
But if I have 4
tenants, I'll need to have:
table_4
I've seen the answer stated here JPA, How to use the same class (entity) to map different tables?
But I need to generate the class by myself.
Is there a way I can generate them dynamically?
////////////// Update //////////////
Columns:
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;
Thanks!