Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsCopying Tenant Data
https://www.eclipse.org/forums/index.php/mv/msg/1079813/1739595/#msg_1739595
I'm using @Multitenant and @TenantDiscriminatorColumn to achieve multi-tenancy in my application.
I would like to be able to create a new tenant from an existing one by copying all data. Does Eclipselink have a facility for this?
I've looked around and it seems that most recommendations are to either
1) load the entire object graph, reset the ids of every entity, and then persist them. I suppose I could try this by changing the tenant property in between loading and persisting.
or
2) create a deep copy (via clone() or serialization) and then persist the copied objects.
Is there nothing in Eclipselink which can handle this for me? Has anyone done something similar?