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

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
evefuji
Posts: 21
Joined: Fri Apr 11, 2014 8:57 pm
Contact:

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

Post by evefuji »

The alternative:

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

Not require to be inner a @AttributeOverrides annotation?

admin
Site Admin
Posts: 10385
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin »

No, @AttributeOverrides is required when you are trying to specify multiple @AttributeOverride. This option has only one, so @AttributeOverrides is not necessary.

sztgeza
Posts: 4
Joined: Thu Sep 04, 2014 2:32 pm
Contact:

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

Post 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?

kdmandawe
Posts: 16
Joined: Sun Aug 04, 2013 9:54 am
Contact:

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

Post by kdmandawe »

Any update on sztgeza's post above? If that's indeed a typo, please update the question bank..

Many thanks,
Kenneth

admin
Site Admin
Posts: 10385
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin »

Yes, he is right. The field in the class should be keyField1. Fixed.
thank you for your feedback!
Paul.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 9 guests