Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » @AttributeOverride at class level for inhereted map attribute
@AttributeOverride at class level for inhereted map attribute [message #1678711] Mon, 16 March 2015 10:00
Emanuele Gesuato is currently offline Emanuele GesuatoFriend
Messages: 12
Registered: December 2012
Junior Member
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


Previous Topic:Custom Sequence Generators with NON-JPA API?
Next Topic:JTA Persistence issue (Null Pointer Exception)
Goto Forum:
  


Current Time: Thu Apr 25 12:19:22 GMT 2024

Powered by FUDForum. Page generated in 0.03399 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top