I am trying to migrate an application from Kodo JDO to Hibernate JPA. I do have a given Table structure and object model. My problem is that our jdo configuration allows to override the name of a join table used for a map in a super class. The following code shows the superclass with the collection to be overridden(The Inheritance strategy is TABLE_PER_CLASS, there is a version and a id field in a super class of OParameterizedADMObjectImpl).
Code:
@MappedSuperclass
public abstract class OParameterizedADMObjectImpl<T extends IADMDataContainer, X extends IADMObjectHandleManager> extends
ADMObjectImpl<T, X> implements IOParameterizedADMObject<T, X>, IOParameterContext {
@OneToMany(cascade=CascadeType.ALL)
@MapKey(name = "key")
@JoinColumn(name="MR_JDOID")
protected Map<String, OParameter> _parameters = null;
The folowing code shows the class deriving from this one which needs to override the mapping of for OParameterizedADMObjectImpl._parameters
Code:
@Entity
public class SecurityConfig extends OParameterizedADMObjectImpl implements ISecurityConfig, Serializable {
...
}
The given table structure for this case is:
SECURITYCONFIG for the security config class and all derived properties
and
SECUR__PARAMETERS as join table for OParameterizedADMObjectImpl._parameters
Now I want to override the mapping of OParameterizedADMObjectImpl._parameters to use a join table. When I do it in OParameterizedADMObjectImpl it looks the folowing way:
Code:
@MappedSuperclass
public abstract class OParameterizedADMObjectImpl<T extends IADMDataContainer, X extends IADMObjectHandleManager> extends
ADMObjectImpl<T, X> implements IOParameterizedADMObject<T, X>, IOParameterContext {
@OneToMany(cascade=CascadeType.ALL)
@MapKey(name = "key")
@JoinTable(name="SECUR__PARAMETERS",joinColumns=@JoinColumn(name="JDOID", referencedColumnName=""), inverseJoinColumns=@JoinColumn(name="JDOID_VALUE"))
protected Map<String, OParameter> _parameters = null;
This works for this class but there are other classes deriving from OParameterizedADMObjectImpl and they should have their own join tables for _parameters e.g. TEST_PARAMETERS.
Is there a way to override the first examples mapping e.g. with @AssociationOverride or with @AttributeOverride?