...
The entity implementation implements the entity interface described above. To identify that this Java class contains the definition of an Entity, four specific Entity annotations must be added to the header of the class.
takes no arguments.@Entity
: First, the@Entity
annotation must be added to the class header to identify the class as definition of an entity. The annotationcan take one argument:
websiteSpecific
. To make@Entity
website specific, the syntax is:Code Block theme Eclipse @Entity(websiteSpecific=true)
@Interfaces
: Secondly, the interface that is associated with this entity must be defined using the@Interfaces
annotation. It takes the full classname (including package) of the associated interface as argument.@Namespace
: Thirdly, the namespace for this entity must be defined for this entity using the@Namespace
annotation. The annotation takes two arguments, the prefix and the URI.Note The plugin defines one namespace and URI for all classes contained by the plugin, including the entity. Usually the namespace and URI are defined in the Activator of the plugin or a Java class containing all constants, like IDs, namespace and URI.
@Nodetype
: Finally, when the Entity will be stored inside the JCR, the@NodeType
annotation should be used to define the node type,super
type andmixin
node types of the node that represents the entity in the JCR. The@NodeType
annotation takes four arguments;name
,registerNodeType
,supertype
andmixin
.
...