JADE Java Persistence API
1.0

com.jadeworld.jade.persistence
Annotation Type OneToOne


@Retention(value=RUNTIME)
@Target(value={FIELD,METHOD})
public @interface OneToOne

Indicates a one-to-one single-values relationship. It must be specified for a property annotated with @DbProperty that is a single-valued reference property; that is, not a primitive type and not a reference to a Collection.

Author:
JADE Development Centre, Jade Software Corporation Ltd.

Optional Element Summary
 java.lang.String constraint
          Optional.
 FetchType fetch
           
 java.lang.String inverse
          The Java name of the inverse property.
 boolean inverseNotRequired
          Optional.
 ReferenceRelationshipType relationshipType
          relationshipType sets the type of relationship for the property.
 boolean transientToPersistentAllowed
          Optional.
 ReferenceUpdateMode updateMode
          updateMode determines what is automatically done by JADE and what by user logic.
 

fetch

public abstract FetchType fetch
Default:
LAZY

relationshipType

public abstract ReferenceRelationshipType relationshipType
relationshipType sets the type of relationship for the property. A peer-to-peer (PEER) relationship is an equivalent relationship between two objects. A parent-child relationship is a relationship in which the child object belongs to or is subsidiary to the parent object. When a parent object is deleted, any child objects are automatically deleted. The relationship is between instances of two classes. A value of PARENT sets this property as the parent and the inverse property as the child. A value of CHILD sets this property as the child and the inverse property as the parent.

Default:
PEER

updateMode

public abstract ReferenceUpdateMode updateMode
updateMode determines what is automatically done by JADE and what by user logic. The MANUAL option specifies that the property is maintained by your Java logic. The AUTOMATIC option means the property is maintained by JADE whenever the property at the other end of the relationship (the inverse) is updated. Automatic references cannot be updated in user logic. The MAN_AUTO option specifies that either end of the relationship can be updated in user logic. The other side of the relationship is automatically maintained by JADE. The DEFAULT option means that a peer-to-peer relationship is MAN_AUTO, A parent relationship is AUTOMATIC and a child relationship is MANUAL.

Default:
DEFAULT

transientToPersistentAllowed

public abstract boolean transientToPersistentAllowed
Optional. Set to true to allow transient instances to reference a persistent instance. In this case, no inverses are updated.

Default:
false

inverseNotRequired

public abstract boolean inverseNotRequired
Optional. Set to true to specify that no exception is raised when no inverse is set during automatic maintenance because the type of the object is not compatible with any of the inverse references or when no inverse is set during automatic maintenance because the constraint fails.

Default:
false

constraint

public abstract java.lang.String constraint
Optional. The name of a condition method that applies as a constraint. It applies only if the updateMode is AUTOMATIC. When the manual side of an inverse reference is set, the property on the automatic side of the reference is set only when this constraint is satisfied.

Default:
""

inverse

public abstract java.lang.String inverse
The Java name of the inverse property.

Default:
""

JADE Java Persistence API
1.0

Copyright © 2007 Jade Software Corporation