incubator-graffito-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexandru Popescu <>
Subject [mapping] mapping enhancement supporting GRFT54
Date Fri, 13 Jan 2006 02:40:25 GMT

I've been thinking about the enhancement in GRFT54 [1]. Currently this is possible, using
  beans. However, the intention would be to allow easier mappings for such examples.

At this moment, a bean is always considered to map to a child node (a one-to-one mapping).
As GRFT54 
is showing, this approach is not covering all possibilites. I guess a greater generality can
reached by allowing a bean to specify its persister class.

The interface that a persister class should implement would be very simple:

  * @param jcrName mapping specified jcrName or fieldName
insert(Session, Node parentNode, String jcrName, Object beanObject);

update(Session, Node parentNode, String jcrName, Object beanObject);

remove(Session, Node parentNode, String jcrName, Object beanObject);

Object load(Session, Node parentNode, String jcrName)

For making things even simplier in some scenario, we can provide such specific persister 
implementations for a few node types defined in the JSR170 (a good example would be nt:file).

Full example:

considering the GRFT54 example, you will write:

<bean-descriptor fieldName="file"
		 converterClass="NtFileConverter" />

and NtFileConverter will be responsible for creating the nt:file node structure. Same mechanism
work for fetching.

I would like to hear you opinion, before starting to work on this idea.



.w( the_mindstorm )p.

View raw message