@Entity
class Order {
...
@Any( metaColumn = @Column( name="payment_type" ) )
@AnyMetDef(
idType = "long"
metaValues = {
@MetaValue( value="C", targetEntity=CashPayment.class ),
@MetaValue( value="CC", targetEntity=CreditCardPayment.class ),
}
)
pubic Payment getPayment() { ... }
}
}
AnyMetaDef
| Modifier and Type | Method and Description |
|---|---|
| public FetchType | fetch()
Defines whether the value of the field or property should be lazily loaded or must be eagerly fetched. |
| public Column | |
| public String | |
| public boolean |
| fetch | back to summary |
|---|---|
| public FetchType fetch() Defines whether the value of the field or property should be lazily loaded or must be eagerly fetched. The EAGER strategy is a requirement on the persistence provider runtime that the value must be eagerly fetched. The LAZY strategy is applied when bytecode enhancement is used. If not specified, defaults to EAGER. | |
| metaColumn | back to summary |
|---|---|
| public Column metaColumn() Identifies the discriminator column. This column will hold the value that identifies the targeted entity. | |
| metaDef | back to summary |
|---|---|
| public String metaDef() Metadata definition used. If defined, should point to a @AnyMetaDef name If not defined, the local (ie in the same field or property) @AnyMetaDef is used | |
| optional | back to summary |
|---|---|
| public boolean optional() Whether the association is optional. If set to false then a non-null relationship must always exist. | |