...
The @Property
annotation has the following properties:
Property | Description |
---|---|
name | The name of this property in the repository. Leave this empty if you want to use the same name as the property in the Java class. |
type | The JSR-170 property type to use. The default is |
| Specifies whether this property is mandatory. The default is |
multiple | Specifies whether the property may have more than one value. The default is |
| Add JSR-170 constraints to the property. By default no constraints are added. |
@Child
The @Child
annotation can be used to indicate that the object should not be stored as a reference property but as a child property of this entity. As a result, the physical location of the object will be such that there will be a parent-child relation between the entity and the object to which is referred by the @Child
annotation.
...
The @Child
annotation has the following properties:
Property | Description |
---|---|
name | The name of this property in the repository. Leave this empty if you want to use the same name as the property in the Java class. |
| Specifies whether this property is mandatory. The default is false. |
allowsSameNameSiblings | Specifies whether this child node can have same-name siblings. In other words, whether the parent node can have more than one child node with the same name. The default is false. |
| Specifies the minimum set of primary node types that the child node must have. The default is {http://www.jcp.org/jcr/nt/1.0}base which is the JSR-170 base type of all node types. |
defaultPrimaryType | Specifies the default primary node type that will be assigned to the child node if it is created without an explicitly specified primary node type. The default is {http://www.jcp.org/jcr/nt/1.0}unstructured which indicates the unstructured node type. |
Note |
---|
|
...
The @collection
annotation has the following properties:
Property | Description |
---|---|
type | The type of the collection property, which must be either |
| Specifies the class associated with the objects contained by the collection. |
lazy | Specifies whether the collection should use lazy loading or not. The default is |
| Specifies if the objects contained by the reference should be stored by reference or as child objects. The default is by reference. |
Note |
---|
The |
...
Persistent classes not managed by the Entity Manager are:
Persistent Class | Description |
---|---|
Custom media item implementation | Class that extends |
Custom element implementation | Class that extends |
A persistent class that is not managed by the Entity Manager may persist its properties using the nl.gx.webmanager.foundation.JcrUtil
class. This class contains methods to read and write values to and from JCR nodes. The getters and setters of an entity managed by the Entity Manager usually only store the value in a class variable and persist the entity by using EntityManager.persist()
. Using JCRUtil
is an alternative to EntityManager.persist()
however it should be invoked to persist each property individually. For example, to persist the company property:
...