jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anirban Majumdar" <anirban.majum...@altair.com>
Subject ObjectContentManager Persisting Child Nodes
Date Mon, 18 Jan 2010 14:21:47 GMT


After searching high and low for a solution to my problem, I've finally
thought of writing in. Even though the subject might suggest that this
problem must've been faced by some other people too, but I couldn't find
any similar issues discussed. Probably I'm just making some simple
mistake :/


Anyways, the problem I face is like this -

I have a node structure like:


[av:ContentType] > nt:base, mix:referenceable, mix:lockable

- av:name (string)


- av:user (string)

- av:version (double)

+ av:metadata (av:ContentMetadataType)

= av:ContentMetadataType




- av:metadataName (string)

- av:metadataId (string)


- av:value



Using annotated Java POJO classes I'm trying to persist the data for a
Content type. The annotations I've added to my Content and
ContentMetadata POJO classes are as follows:




    @Field (uuid = true)

    private String id;


    @Field (jcrName = "av:name")

    private String name;


    @Field (jcrName = "av:user")

    private String user;


    @Field (jcrName = "av:version")

    private double version;


    @Collection (jcrElementName = "av:metadata", jcrName = "av:name", 

                    jcrType = "av:ContentMetadataType")

    private List<ContentMetadata> assocMetatadata;


    @Field (path = true)

    private String path = "/av:content"; 





    @Field (jcrName = "av:metadataId")

    String metadataId;


    @Field (jcrName = "av:metadataName")

    String metadataName;


    @Field (jcrName = "av:value")

    String value;


    @Field (path = true)

    String path = "/av:content/av:metadata";



Now, when I try to persist an instance of Content.java using OCM, I keep
encountering the following exception:


javax.jcr.nodetype.ConstraintViolationException: no matching child node
definition found for {http://av.com/vault}metadata



Any assistance to solve this problem is much appreciated.






  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message