@Target(value={METHOD,FIELD}) @Retention(value=RUNTIME) public @interface Any
@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 | Required Element and Description |
---|---|
Column |
metaColumn
Identifies the discriminator column.
|
Modifier and Type | Optional Element and Description |
---|---|
FetchType |
fetch
Defines whether the value of the field or property should be lazily loaded or must be
eagerly fetched.
|
String |
metaDef
Metadata definition used.
|
boolean |
optional
Whether the association is optional.
|
public abstract Column metaColumn
public abstract String metaDef
public abstract FetchType fetch
Copyright © 2001-2017 Red Hat, Inc. All Rights Reserved.