Annotation Interface ForeignKeyRole


@Retention(CLASS) @Target({}) @Documented public @interface ForeignKeyRole
A role descriptor for the aggregated (one/zero-to-one) side of a foreign key association. Note that if you're constraining an existing foreign key association, you should only need to explicitly specify the name() and type() (the name is needed to determine what's being constrained, and the type indicates the new, constrained class).

Supported API: true

See Also:
  • Element Details

    • name

      String name
      The name of this role. To constrain an existing (inherited) association (by specifying a subclass/interface of the inherited association's type()), assign the name to the same name provided by the association being constrained.

      Rose conversion note: Corresponds to Association Specification -> General -> Role A/B.

      Supported API: true

    • type

      Class type
      The type/class of this property. Must be a Persistable.

      Rose conversion note: Corresponds to Association Specification -> General -> Element A/B.

      Supported API: true

      See Also:
    • javaDoc

      String javaDoc
      A string representing the JavaDoc to generate for this property. Leave blank only if you want to reuse the parent role's JavaDoc.

      Rose conversion note: Corresponds to Association Specification -> Role A/B General -> Documentation.

      Supported API: true

      See Also:
      Default:
      ""
    • supportedAPI

      SupportedAPI supportedAPI
      The supported nature of this property to be generated into your marvelous JavaDoc .

      Rose conversion note: Corresponds to Association Specification -> Windchill A/B -> SupportedAPI.

      Supported API: true

      Default:
      PRIVATE
    • referenceType

      Class referenceType
      The reference type to store this role as, defaulting to either the parent's referenceType or ObjectReference. Note that if you are implementing an interface that models a foreign key with a referenceType of WTReference, it is your responsibility to identify the implementing reference type.

      Rose conversion note: Corresponds to Association Specification -> Windchill A/B -> ReferenceType.

      Supported API: true

      Default:
      java.lang.Object.class
    • autoNavigate

      boolean autoNavigate
      Whether or not to auto-navigate this role. If unspecified, reuses the parent role's value, finally defaulting to false if no parent exists.

      If the foreign key role is concrete (see type()) and required (see constraints()), it can be auto-navigated by setting this property to true. Auto-navigated foreign keys will automatically join the foreign key role's table into queries of this GenAs class, making it possible to access the role via the generated "getter" API without returning to the database to inflate it.

      Rose conversion note: Corresponds to Association Specification -> Windchill A/B -> AutoNavigate.

      Supported API: true

      Default:
      false
    • owner

      boolean owner
      Indicates whether this role is an "owner" role. Ownership is checked when an object of this role's type is deleted: if the object is being referred to (in a foreign key reference held by an object on the other side of this foreign key association), the delete will fail if this is set to false. Assign this to true if you would like the delete to succeed regardless of existing foreign key associations to it of this type, noting that the foreign key reference(s) will be nulled out as part of the deletion.

      If unspecified, will use the first specified value for any parent associations, ultimately defaulting to true.

      Rose conversion note: Corresponds to Association Specification -> Windchill A/B -> Owner.

      Supported API: true

      Default:
      true
    • cascade

      boolean cascade
      Indicates whether deletes should cascade. If set to true, the persistence layer will attempt to delete this object when an object referring to it (in its foreign key reference for the other side of this foreign key association) is deleted.

      If unspecified, uses the parent's value or false if no parent.

      Rose conversion note: Corresponds to Association Specification -> Windchill A/B -> Cascade.

      Supported API: true

      Default:
      false
    • accessors

      Controls the accessibility and exceptions for generated accessor methods. If unspecified, uses parent's role or @PropertyAccessors if no parent. This property corresponds to the accessors generated for the foreign key link class (resembling a binary link) that's automatically generated when a foreign key is generated; it does not correspond to the accessors generated on the persistable itself (see ForeignKeyRole).

      Rose conversion note: Corresponds to various properties found in Association Specification -> Windchill A/B.

      Supported API: true

      Default:
      @com.ptc.windchill.annotations.metadata.PropertyAccessors
    • constraints

      PropertyConstraints constraints
      Assigns the cardinality (via PropertyConstraints.required()) and changeability (via PropertyConstraints.changeable()) of this foreign key role.

      Rose conversion note: Corresponds to various properties found in Class Attribute Specification -> Windchill as well as Association Specification -> Role A/B Detail -> Multiplicity.

      Supported API: true

      Default:
      @com.ptc.windchill.annotations.metadata.PropertyConstraints
    • columnProperties

      ColumnProperties columnProperties
      Specifies the database properties for the columns of this role. Defaults to the parent's role or @ColumnProperties if unspecified.

      Rose conversion note: Corresponds to various properties found in Association Specification -> Windchill A/B.

      Supported API: true

      Default:
      @com.ptc.windchill.annotations.metadata.ColumnProperties