Use @Property
to specify a single user-defined property on a mapped attribute or its get
/set
method. Use the @Properties
annotation to wrap multiple properties.
Although not used by TopLink, you can specify mapping properties if an application or extension needs to extend TopLink metadata.
Table 2-54 describes this annotation's elements.
Table 2-54 @Properties Annotation Elements
Annotation Element | Description | Default |
---|---|---|
Property |
Array of |
You can specify @Property
on a mapped attribute (or its get
/set
method) within an Entity, MappedSuperclass, or Embeddable class. You can also specify this annotation on an Entity, MappedSuperclass, or Embeddable class.
Properties defined in MappedSuperclass are passed to all inheriting Entities and MappedSuperclasses. In case of a conflict, property values defined directly on a class always override values inherited from a class's parent.
When using an orm.xml
mapping file, TopLink ignores @Property
and @Properties
specified in annotations on mapped attributes; annotations on classes are merged with those specified i the orm.xml
file, with the latter taking precedence in case of conflicts.
Example 2-114 shows how to use the @Properties
annotation within a @Transformation
mapping. Example 2-115 shows how to use the <properties>
XML element within the orm.xml
file.
For more information, see: