jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gonzalo Aguilar Delgado <gagui...@aguilardelgado.com>
Subject Re: Collections: How to use? What's the collection converter?
Date Fri, 16 Jul 2010 17:31:55 GMT
Hi Again, 

I want to be more specific. I was looking at the example found in:
http://jackrabbit.apache.org/mapping-stategies.html
http://jackrabbit.apache.org/mapping-collection-fields.html


But, That's not what I want. It seems that collections here are used to
map childen nodes. This example is also incomplete because we cannot see
how to build the class to support this feature.

In my case I just want to have a collection of item,value filled in and
stored in the repository.

I created something like:
	@Collection(proxy=false, jcrName="j2:decorators", 
			  elementClassName=String.class)
	protected HashMap<String, String> decorators = new HashMap<String,
String>();


With properties created as:

	public HashMap<String, String> getDecorators() {
		return decorators;
	}

	public void setDecorators(HashMap<String, String> decorators) {
		this.decorators = decorators;
	}

My nodetype definition is as follows:


	<nodeType name="j2:jetspeedskinnabledecorableimpl" isMixin="false"
		hasOrderableChildNodes="false" primaryItemName="">
		<supertypes>
			<supertype>j2:jetspeedhierarchyimpl</supertype>
		</supertypes>
		<propertyDefinition name="j2:skin" requiredType="String"
			autoCreated="false" mandatory="false" onParentVersion="COPY"
			protected="false" multiple="false">
			<defaultValues>
				<defaultValue></defaultValue>
			</defaultValues>
		</propertyDefinition>
		
		<propertyDefinition name="j2:decorators" requiredType="String"
			autoCreated="false" mandatory="false" onParentVersion="COPY"
			protected="false" multiple="false">
			<defaultValues>
				<defaultValue></defaultValue>
			</defaultValues>
		</propertyDefinition>
	</nodeType>


But for me this does not work. Says that class String is not mapped. It
shouldn't.

So I'm sure that I'm not handling this properly. 

How can I do what I want?

Thank you.



El vie, 16-07-2010 a las 13:23 +0200, Gonzalo Aguilar Delgado escribió:
> Hi all!
> 
> I'm trying to understand the correct use of collections mapping of the
> jackrabbit OCM.
> 
> 	@Collection(proxy=true, 
> 			  elementClassName=SomeClass.class,
> collectionConverter=NTCollectionConverterImpl.class)
> 
> I found something like this but I really don't understand what's going
> on with this.
> 
> Is there any good explanation about how to use? The main page is almost
> empty...
> 
> Thank you.
> 
> 
> 
> 
> 
> 
> 
> ____________________________________
> 
> 
> 
> 
>   Gonzalo Aguilar Delgado
>   Consultor CRM - Ingeniero en
> Informática
>         M. +34 607814276
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 


Mime
View raw message