[
https://issues.apache.org/jira/browse/JCR-1889?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jukka Zitting updated JCR-1889:
-------------------------------
Fix Version/s: (was: 1.6.0)
1.5.3
Merged to the 1.5 branch in revision 743331.
> Incorrect support for java interfaces in typed collection fields
> ----------------------------------------------------------------
>
> Key: JCR-1889
> URL: https://issues.apache.org/jira/browse/JCR-1889
> Project: Jackrabbit Content Repository
> Issue Type: Bug
> Components: jackrabbit-ocm
> Affects Versions: 1.4, 1.5.0
> Reporter: Christophe Lombart
> Assignee: Christophe Lombart
> Fix For: 1.5.3
>
>
> 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.