mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-10 05:04:52 +00:00
fix doc because @AnyKeyJavaClass seems to be required
This commit is contained in:
parent
4a716b1b81
commit
ee0b22f189
@ -584,6 +584,7 @@ class Order {
|
||||
...
|
||||
|
||||
@Any
|
||||
@AnyKeyJavaClass(UUID.class) //the foreign key type
|
||||
@JoinColumn(name="payment_id") // the foreign key column
|
||||
@Column(name="payment_type") // the discriminator column
|
||||
// map from discriminator values to target entity types
|
||||
@ -612,6 +613,21 @@ There are a number of annotations which are useful to express this sort of compl
|
||||
|
||||
Of course, `@Any` mappings are disfavored, except in extremely special cases, since it's much more difficult to enforce referential integrity at the database level.
|
||||
|
||||
There's also currently some limitations around querying `@Any` associations in HQL.
|
||||
This is allowed:
|
||||
|
||||
[source,hql]
|
||||
----
|
||||
from Order ord
|
||||
join CashPayment cash
|
||||
on id(ord.payment) = cash.id
|
||||
----
|
||||
|
||||
[CAUTION]
|
||||
====
|
||||
Polymorphic association joins for `@Any` mappings are not currently implemented.
|
||||
====
|
||||
|
||||
[[bytecode-enhancer]]
|
||||
=== Using the bytecode enhancer
|
||||
|
||||
|
@ -42,6 +42,7 @@
|
||||
* class Order {
|
||||
* ...
|
||||
* @Any
|
||||
* @AnyKeyJavaClass(UUID.class) //the foreign key type
|
||||
* @JoinColumn(name="payment_id") //the foreign key column
|
||||
* @Column(name="payment_type") //the discriminator column
|
||||
* @AnyDiscriminatorValue(discriminator="CASH", entity=CashPayment.class)
|
||||
|
Loading…
x
Reference in New Issue
Block a user