

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
6 messages in org.apache.jackrabbit.usersRe: Using Collections - OCM| From | Sent On | Attachments |
|---|---|---|
| Kaizer | Oct 24, 2007 4:55 am | |
| Christophe Lombart | Oct 25, 2007 11:50 pm | |
| Kaizer | Oct 26, 2007 12:38 am | |
| Christophe Lombart | Oct 26, 2007 1:02 am | |
| Kaizer | Oct 26, 2007 2:13 am | |
| Christophe Lombart | Oct 26, 2007 5:16 am |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: Using Collections - OCM | Actions... |
|---|---|---|
| From: | Christophe Lombart (chri...@gmail.com) | |
| Date: | Oct 25, 2007 11:50:11 pm | |
| List: | org.apache.jackrabbit.users | |
Sorry for the delay I was very busy this week.
Which inheritance strategy are you using ? Are you using the a discriminator or a different node type per Class ?
There are 2 possibilities :
1/ Using a different node type per class in the hierarchy, here is a example from the unit test. The implement-descriptor is not mandatory.
<class-descriptor className="org.apache.jackrabbit.ocm.testmodel.inheritance.impl.FolderImpl" jcrType="ocm:folderimpl"
extend="org.apache.jackrabbit.ocm.testmodel.inheritance.impl.CmsObjectImpl" discriminator="false" > <implement-descriptor interfaceName="org.apache.jackrabbit.ocm.testmodel.interfaces.Folder" /> <collection-descriptor fieldName="children" proxy="true" autoUpdate="false"
elementClassName="org.apache.jackrabbit.ocm.testmodel.inheritance.impl.CmsObjectImpl"
collectionConverter="org.apache.jackrabbit.ocm.manager.collectionconverter.impl.NTCollectionConverterImpl"
/>
</class-descriptor >
2/ Using a discriminator (discriminator =true). It can be used when you are using the same node type for the complete class hierarchy. There is no unit tests on collection-descriptor with a discriminator. So, I will write a new unit test for this use cases and I will give some feedback. So maybe there are some bug for this kind of situation.
Again sorry for the delay.
br, Christophe
On 10/24/07, Kaizer <Kaiz...@mastek.com> wrote:
Hi,
I have a class A which has a collection of objects of type B. I have made the corresponding definitions in the mapping xml. However, If i create a class C which extends B and save objects of type C in the list and then try to retrieve them, I always get an instance of B as the ObjectConverterImpl always creates a new instance of the "elementClassName" defined in the mapping (which would be B in this case). How can i achieve the storage and retrieval in this scenario?Would I require a custom CollectionConverter?
Thanks.
Regards Kaizer -- View this message in context: http://www.nabble.com/Using-Collections---OCM-tf4683858.html#a13384206 Sent from the Jackrabbit - Users mailing list archive at Nabble.com.







