jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting (JIRA)" <j...@apache.org>
Subject [jira] Updated: (JCR-1889) Incorrect support for java interfaces in typed collection fields
Date Tue, 02 Dec 2008 11:08:46 GMT

     [ https://issues.apache.org/jira/browse/JCR-1889?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jukka Zitting updated JCR-1889:
-------------------------------

    Component/s: jackrabbit-ocm

> Incorrect support for java interfaces in typed collection fields
> ----------------------------------------------------------------
>
>                 Key: JCR-1889
>                 URL: https://issues.apache.org/jira/browse/JCR-1889
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-ocm
>    Affects Versions: 1.4, 1.5.0
>            Reporter: Christophe Lombart
>            Assignee: Christophe Lombart
>
> If a typed collection field is defined with an Interface as the type, the following exception
is thrown when the main object is inserted : 
> org.apache.jackrabbit.ocm.exception.JcrMappingException: Cannot load class interface
[name of the interface];
> Here is a example : 
> @Node
> public class EntityA {
>        @Field(path=true) String path;
>        @Collection List<MyInterface> entityB;
>        ....
> }
> When inserting a new instance of EntityA with a not null entityB, the exception is thrown.

> A workaround is to add the elementClassName on the annotation @Collection. ex. : 
> @Collection (elementClassName=MyInterface.class) List<MyInterface> entityB;
> elementClassName is used only for untyped collections but if you specify it for a typed
collection, the ObjectContentManager will not use reflexion to check the collection class
name. 
>  
> This should be nice to avoid the usage of elementClassName for typed collections. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message