Page 1 of 1

About Question enthuware.oce-jpad.v6.2.415 :

Posted: Sun Apr 13, 2014 7:51 pm
by evefuji
The alternative:

@AttributeOverride( name="value.embeddableValue1", column=@Column(name="EV_1") )

Not require to be inner a @AttributeOverrides annotation?

Re: About Question enthuware.oce-jpad.v6.2.415 :

Posted: Sun Apr 13, 2014 8:20 pm
by admin
No, @AttributeOverrides is required when you are trying to specify multiple @AttributeOverride. This option has only one, so @AttributeOverrides is not necessary.

Re: About Question enthuware.oce-jpad.v6.2.415 :

Posted: Thu Sep 04, 2014 2:44 pm
by sztgeza
One of the correct options is:

Code: Select all

@AttributeOverrides(     {     @AttributeOverride( name="value.embeddableValue1",   column=@Column(name="EV_1") ),     @AttributeOverride( name="value.embeddableValue2",   column=@Column(name="EV_2") ),     @AttributeOverride( name="key.keyField1", column=@Column(name="KF_1") )   } )
However, it seems that it's wrong - the second @AttributeOverride contains "key.keyField1" (with capital 'F'), but in

Code: Select all

public class EmbeddableKey implements Serializable {     private String keyfield1;
you can see, there is keyfield1, with lowercase 'f'.
Therefore (, at least using Eclipselink schemagenerator) an exception will be thrown:
Exception Description: The attribute [keyField1] was not found on the embeddable class [class ch04.embedded.model.EmbeddableKey]. It is referenced in an attribute override for the embedded attribute [embeddedData] on class [class ch04.embedded.model.Employee].
As far as I know, field names are case sensitive. I'm not sure does the exception occur only at schemageneration?

Re: About Question enthuware.oce-jpad.v6.2.415 :

Posted: Fri Dec 05, 2014 4:34 am
by kdmandawe
Any update on sztgeza's post above? If that's indeed a typo, please update the question bank..

Many thanks,
Kenneth

Re: About Question enthuware.oce-jpad.v6.2.415 :

Posted: Fri Dec 05, 2014 9:47 am
by admin
Yes, he is right. The field in the class should be keyField1. Fixed.
thank you for your feedback!
Paul.