Hi there,
I am using eclipse link 2.5.2 and I am trying to redefine the length of a column related of an inhereted attribute.
This is my entity:
@Entity
@AttributeOverride(name="[b]l10nValues.value[/b]", column=@Column(length=2048))
public class SectionContent extends MyEntity
{
/**
* @generated
*/
private static final long serialVersionUID = 1L;
/**
* <!-- begin-user-doc --><!-- end-user-doc -->
*
* @generated
*/
@Id()
@GeneratedValue(generator = "agent_sectioncontent")
@SequenceGenerator(name = "agent_sectioncontent", sequenceName = "agent_sectioncontent_seq")
private long id = 0;
}
Where MyEntity is defined in this way:
@MappedSuperclass
public abstract class MyEntity {
private static final long serialVersionUID = 1L;
/**
* {@link Map} containing the String localized values.
*/
@ElementCollection
protected Map<LocalizedField, String> l10nValues = new HashMap<LocalizedField, String>();
@XmlPath(".")
@XmlJavaTypeAdapter(value = L10NMapXmlAdapter.class)
protected Map<LocalizedField, String> getL10nValues() {
return l10nValues;
}
/**
* Sets the {@link Map} with the localized field value.<br>
* Useful for JAXB serialization.
*
* @param l10nValues
*/
protected void setL10nValues(Map<LocalizedField, String> l10nValues) {
this.l10nValues = l10nValues
}
}
As you can see I am trying to redefine the length of "l10nValues.value" column which is a string but I got the error
Exception Description: The attribute [value] was not found on the embeddable class [class com.thedigitalstack.model.l10n.LocalizedField]. It is referenced in an attribute override for the embedded attribute [l10nValues] on class [class com.finantix.agent.core.SectionContent].
In attachment you can found the full log.
I tried to go in debug in eclipse link code but I found that it can override only the key part of a map, not the value. In MappingAccessor class the attribute overrides is handled only for the key part (processEmbeddableMapKeyClass) not for the value part.
Is it correct ? Is there a way to change the length of the 'value' part of a map ?
Thanks