net.sourceforge.pbeans.annotations
Annotation Type PersistentProperty


@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface PersistentProperty

Annotation for a persistent bean property. It can be put next to a getter or setter, but not both. The TransientProperty annotation takes precendence.


Optional Element Summary
 java.lang.String field
          The requested field name.
 boolean globalReference
          Define this element as true when a property must be able to refer to persistent objects of different types.
 boolean nullable
          Whether the database field should be declared nullable.
 java.lang.String renamedFrom
          If the property is renamed from another, provide the name of the renamed field with this annotation value.
 

field

public abstract java.lang.String field
The requested field name.

Default:
""

nullable

public abstract boolean nullable
Whether the database field should be declared nullable.

Default:
true

renamedFrom

public abstract java.lang.String renamedFrom
If the property is renamed from another, provide the name of the renamed field with this annotation value. (Unless explicitly requested with the fieldName value, or unless truncated due to length, field names are the same as property names).

Normally when a property is renamed the effect is no different to removing the old property and creating a new one, which will result in loss of all data stored by the renamed property. This annotation value helps retain the old property's data.

Default:
""

globalReference

public abstract boolean globalReference
Define this element as true when a property must be able to refer to persistent objects of different types. A property whose compile-time type is Object may be defined to be a global reference by means of this element. Persistent reference properties not defined to be global must have a compile-time type that exactly matches the run-time type of property values.

Use of this element is not recommended under normal circumstances.

Default:
false