How do I specify the graffito jcr mapping for classes that extend ArrayList

View: New views
4 Messages — Rating Filter:   Alert me  

How do I specify the graffito jcr mapping for classes that extend ArrayList

by rajab57 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Example

import java.util.ArrayList;
import java.util.ListIterator;

public class MainClass {
   private ElementsList elements;

}

public class ElementsList extends ArrayList<Elements>  {
  private static final long serialVersionUID = 1L;

}


public class Element {
   private String name ;
   private String id ;

}

 


Re: How do I specify the graffito jcr mapping for classes that extend ArrayList

by Christophe Lombart :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The jcr mapping tools has been moved into the Jackrabbit project (
http://jackrabbit.apache.org). I advise you to use the Jackrabbit mailing
list.

FYI, ArrayList are supportedd by default.

If you want to support your own collection/map class :
1/ your collection/map class have to implement the ManagableCollection
interface.
2/ You have to specify the collection class name in the mapping file.

We have a unit test with an specific HashMap. That's exactly the same for
collection like ArrayList, ...
* See the class HashMapElement which implement the interface
ManageableCollection
* See the unit test HashMapTest.
* Check in the mapping file "jcrmapping.xml" the mapping descriptor for the
class o.a.j.ocm.testmodel.hashmap.Main which contains a descriptor based on
the HashMapElement class.

HTH
Christophe


On 5/31/07, rajab57 <rajalakshmi@...> wrote:

>
>
>
> Example
>
> import java.util.ArrayList;
> import java.util.ListIterator;
>
> public class MainClass {
>    private ElementsList elements;
>
> }
>
> public class ElementsList extends ArrayList<Elements>  {
>   private static final long serialVersionUID = 1L;
>
> }
>
>
> public class Element {
>    private String name ;
>    private String id ;
>
> }
>
>
>
>
> --
> View this message in context:
> http://www.nabble.com/How-do-I-specify-the-graffito-jcr-mapping-for-classes-that-extend-ArrayList-tf3848661.html#a10901203
> Sent from the Graffito - Dev mailing list archive at Nabble.com.
>
>

Re: How do I specify the graffito jcr mapping for classes that extend ArrayList

by rajab57 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Thanks for the reply.

I will refer to the jackrabbit project in future. I did not realize that the process has happened.
I looked at the example for HashMap. And I have implemented the case of ArrayList, Set etc.
In this scenario this ElementsList extends ArrayList. And I was not sure how I can specify that mapping.

Thanks again,
Raji

Christophe Lombart wrote:
The jcr mapping tools has been moved into the Jackrabbit project (
http://jackrabbit.apache.org). I advise you to use the Jackrabbit mailing
list.

FYI, ArrayList are supportedd by default.

If you want to support your own collection/map class :
1/ your collection/map class have to implement the ManagableCollection
interface.
2/ You have to specify the collection class name in the mapping file.

We have a unit test with an specific HashMap. That's exactly the same for
collection like ArrayList, ...
* See the class HashMapElement which implement the interface
ManageableCollection
* See the unit test HashMapTest.
* Check in the mapping file "jcrmapping.xml" the mapping descriptor for the
class o.a.j.ocm.testmodel.hashmap.Main which contains a descriptor based on
the HashMapElement class.

HTH
Christophe


On 5/31/07, rajab57 <rajalakshmi@gmail.com> wrote:
>
>
>
> Example
>
> import java.util.ArrayList;
> import java.util.ListIterator;
>
> public class MainClass {
>    private ElementsList elements;
>
> }
>
> public class ElementsList extends ArrayList<Elements>  {
>   private static final long serialVersionUID = 1L;
>
> }
>
>
> public class Element {
>    private String name ;
>    private String id ;
>
> }
>
>
>
>
> --
> View this message in context:
> http://www.nabble.com/How-do-I-specify-the-graffito-jcr-mapping-for-classes-that-extend-ArrayList-tf3848661.html#a10901203
> Sent from the Graffito - Dev mailing list archive at Nabble.com.
>
>

Re: How do I specify the graffito jcr mapping for classes that extend ArrayList

by Christophe Lombart :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If you have time, I will add add a new unit test with an ArrayList (hope for
this wk).

br,
Christophe


On 5/31/07, rajab57 <rajalakshmi@...> wrote:

>
>
> Hi,
>
> Thanks for the reply.
>
> I will refer to the jackrabbit project in future. I did not realize that
> the
> process has happened.
> I looked at the example for HashMap. And I have implemented the case of
> ArrayList, Set etc.
> In this scenario this ElementsList extends ArrayList. And I was not sure
> how
> I can specify that mapping.
>
> Thanks again,
> Raji
>
>
> Christophe Lombart wrote:
> >
> > The jcr mapping tools has been moved into the Jackrabbit project (
> > http://jackrabbit.apache.org). I advise you to use the Jackrabbit
> mailing
> > list.
> >
> > FYI, ArrayList are supportedd by default.
> >
> > If you want to support your own collection/map class :
> > 1/ your collection/map class have to implement the ManagableCollection
> > interface.
> > 2/ You have to specify the collection class name in the mapping file.
> >
> > We have a unit test with an specific HashMap. That's exactly the same
> for
> > collection like ArrayList, ...
> > * See the class HashMapElement which implement the interface
> > ManageableCollection
> > * See the unit test HashMapTest.
> > * Check in the mapping file "jcrmapping.xml" the mapping descriptor for
> > the
> > class o.a.j.ocm.testmodel.hashmap.Main which contains a descriptor based
> > on
> > the HashMapElement class.
> >
> > HTH
> > Christophe
> >
> >
> > On 5/31/07, rajab57 <rajalakshmi@...> wrote:
> >>
> >>
> >>
> >> Example
> >>
> >> import java.util.ArrayList;
> >> import java.util.ListIterator;
> >>
> >> public class MainClass {
> >>    private ElementsList elements;
> >>
> >> }
> >>
> >> public class ElementsList extends ArrayList<Elements>  {
> >>   private static final long serialVersionUID = 1L;
> >>
> >> }
> >>
> >>
> >> public class Element {
> >>    private String name ;
> >>    private String id ;
> >>
> >> }
> >>
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/How-do-I-specify-the-graffito-jcr-mapping-for-classes-that-extend-ArrayList-tf3848661.html#a10901203
> >> Sent from the Graffito - Dev mailing list archive at Nabble.com.
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/How-do-I-specify-the-graffito-jcr-mapping-for-classes-that-extend-ArrayList-tf3848661.html#a10901887
> Sent from the Graffito - Dev mailing list archive at Nabble.com.
>
>
LightInTheBox - Buy quality products at wholesale price