jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christophe Lombart" <christophe.lomb...@gmail.com>
Subject Re: Annotating a java.io.File type field in OCM
Date Thu, 13 Nov 2008 15:51:20 GMT
Because @Bean cannot be used with primitive types (or their wrapper
classes). You should use @Field.



On Thu, Nov 13, 2008 at 15:52, Fard <maurice.fard@gmail.com> wrote:

>
> Hi Christophe,
>
> Thank you for replay. I have another problem that I could not solve it. One
> of my field has java.lang.Object type and I would like to map it. I
> downloaded second tutorial code sample "How to map associations between
> objects" and I added one field to Author class as Object type and I used
> Bean Converter for it
>
>        @Bean private Object value;
>                 { setter and getter }
>
> In the startTutorial method of Main class I added
>
>        String value = new String("This is a value for Object.");
>        pressRelease.getAuthor().setValue(value);
>
> As you Know Author class is a field of PressRelease class that has the Bean
> Converter.
>
> I got the below error. I hope there is a solution for this problem. Thanks
> for any help.
>
> Regards
> Maurice
>
> Start the tutorial ...
> Insert a press release in the repository
> Exception in thread "main"
> org.apache.jackrabbit.ocm.exception.RepositoryException: null; nested
> exception is
> org.apache.jackrabbit.ocm.exception.IncorrectPersistentClassException:
> Class
> of type: java.lang.String has no descriptor.
> org.apache.jackrabbit.ocm.exception.IncorrectPersistentClassException:
> Class
> of type: java.lang.String has no descriptor.
>        at
>
> org.apache.jackrabbit.ocm.mapper.impl.AbstractMapperImpl.getClassDescriptorByClass(AbstractMapperImpl.java:203)
>        at
>
> org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterImpl.insertBeanFields(ObjectConverterImpl.java:810)
>        at
>
> org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterImpl.insert(ObjectConverterImpl.java:224)
>        at
>
> org.apache.jackrabbit.ocm.manager.beanconverter.impl.DefaultBeanConverterImpl.insert(DefaultBeanConverterImpl.java:53)
>        at
>
> org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterImpl.insertBeanFields(ObjectConverterImpl.java:810)
>        at
>
> org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterImpl.insert(ObjectConverterImpl.java:224)
>        at
>
> org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterImpl.insert(ObjectConverterImpl.java:153)
>        at
>
> org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl.insert(ObjectContentManagerImpl.java:406)
>        at org.apache.jackrabbit.ocm.Main.startTutorial(Main.java:60)
>        at org.apache.jackrabbit.ocm.Main.main(Main.java:134)
>
>
>
> Christophe Lombart wrote:
> >
> > JCR doesn't support java.io.File but you can create a utility method to
> > get
> > the InputStream from a File.
> > InputStream is supported in Jackrabbit OCM.
> >
> > Christophe
> >
> >
> > On Thu, Nov 13, 2008 at 01:42, Fard <maurice.fard@gmail.com> wrote:
> >
> >>
> >> Hello there,
> >>
> >> One of my filed has java.io.File type. I don't know how can I annotate
> it
> >> in
> >> OCM. It is not @Field and it is not @Bean.
> >>
> >> Thanks for any help
> >>
> >> Maurice
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Annotating-a-java.io.File-type-field-in-OCM-tp20472733p20472733.html
> >> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Annotating-a-java.io.File-type-field-in-OCM-tp20472733p20481630.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>
>

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