Could you please post mapping XML? There were a few snags with vertical
inheritance. Could be one of them.
Andrus
On May 12, 2011, at 8:10 PM, Hans C. Poo wrote:
> Hi,
>
> I'm using stable cayenne 3.0.1.
>
> Following the tutorial in vertical inheritance i've been unable to make
> vertical inheritance work.
>
> I've modified the tutorial app adding a Programmar as Child of Artist.
>
> It have the following error:
>
> Exception in thread "main" org.apache.cayenne.validation.ValidationException:
> [v.3.0.1 Sep 06 2010 15:09:38] Validation failures: Validation failure for
> org.apache.cayenne.tutorial.persistent.Programmer.artist: "artist" is
> required.
> Validation failure for
> org.apache.cayenne.tutorial.persistent.Programmer.artist: "artist" is
> required.
> at
> org.apache.cayenne.access.ObjectStoreGraphDiff.validateAndCheckNoop(ObjectStoreGraphDiff.java:111)
> at
> org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:1095)
> at
> org.apache.cayenne.access.DataContext.commitChanges(DataContext.java:1045)
> at org.apache.cayenne.tutorial.Main.main(Main.java:48)
>
> The code for creating a new Programmer in main is:
>
> Programmer picasso = context.newObject(Programmer.class);
> picasso.setTipo("P"); // Discriminator added in Artist
> picasso.setName("Pablo Picasso");
> picasso.setDateOfBirthString("18811025");
>
> Any help will be appreciated.
> Bye
>
> Hans Poo, Welinux S.A.
> Bombero Ossa #1010, oficina 526,
> +56-2-3729770, Movil: +56-9-3199305
> Santiago, Chile
>
>
>