I’m working in a Java project where I need to make automatically an application (ear file) multitenant. A minimum configuration (view here http://wiki.eclipse.org/EclipseLink/Development/Indigo/Multi-Tenancy) to enable multitenancy in a given entity is :
@Entity
@Table(name="EMP")
@Multitenant
public Employee() {
...
}
My goal is to add dynamically the @Multitenant annotation to all entities and my question is: is there a solution other that editing the bytecode to add this annotation?
Thanks in advance.
You could use an orm.xml if you don’t want to change the code.
You could also use a SessionCustomizer to configure a MultitenantPolicy on each ClassDescriptor.