org.jcrom.annotations
Annotation Type JcrChildNode


@Retention(value=RUNTIME)
@Target(value=FIELD)
public @interface JcrChildNode

This annotation is used to mark fields that are to be mapped as JCR child nodes. It can be applied to fields whos type has been mapped to Jcrom, or to a java.util.List that is parameterized with a mapped implementation.

Note that JCROM creates a container node for all child nodes. The child node is then created with the name retrieved via calling JcrEntity.getName() on the child object.

Author:
Olafur Gauti Gudmundsson

Optional Element Summary
 java.lang.String[] containerMixinTypes
          Mixin types to be added to the container node.
 java.lang.String containerNodeType
          The node type to be applied for the child container node.
 boolean createContainerNode
          Setting this to false will mean not creating a container node for single child objects.
 boolean lazy
          Setting this to true will turn on lazy loading for this field.
 java.lang.String name
          The name of the JCR container node for the child/children.
 

name

public abstract java.lang.String name
The name of the JCR container node for the child/children. Defaults to the name of the field being annotated.

Returns:
the name of the JCR node storing the child that the field represents
Default:
"fieldName"

containerNodeType

public abstract java.lang.String containerNodeType
The node type to be applied for the child container node. Defaults to "nt:unstructured".

Returns:
the node type to use when creating a container node for the children
Default:
"nt:unstructured"

containerMixinTypes

public abstract java.lang.String[] containerMixinTypes
Mixin types to be added to the container node.

Returns:
the mixin types for the child container node
Default:
{}

lazy

public abstract boolean lazy
Setting this to true will turn on lazy loading for this field. The default is false.

Returns:
whether to apply lazy loading to this field
Default:
false

createContainerNode

public abstract boolean createContainerNode
Setting this to false will mean not creating a container node for single child objects. This does not apply for Lists or Maps of child nodes. The default is true.

Returns:
whether to create a child container node
Default:
true


Copyright © 2009. All Rights Reserved.