Skip to content

Commit

Permalink
HHH-13156 - Enhance the @AnyMetaDef annotation section with more deta…
Browse files Browse the repository at this point in the history
…ils about the optimal placement
  • Loading branch information
johnlinp authored and vladmihalcea committed Dec 12, 2018
1 parent 9ff14a3 commit 0d2fa6e
Showing 1 changed file with 2 additions and 3 deletions.
Expand Up @@ -542,8 +542,6 @@ The `property_id` is used to match the `id` column of either the `string_propert
while the `property_type` is used to match the `string_property` or the `integer_property` table.

The table resolving mapping is defined by the `metaDef` attribute which references an `@AnyMetaDef` mapping.
Although the `@AnyMetaDef` mapping could be set right next to the `@Any` annotation,
it's good practice to reuse it, therefore it makes sense to configure it on a class or package-level basis.

The `package-info.java` contains the `@AnyMetaDef` mapping:

Expand All @@ -558,7 +556,8 @@ include::{sourcedir}/any/package-info.java[tags=associations-any-meta-def-exampl

[NOTE]
====
It is recommended to place the `@AnyMetaDef` mapping as a package metadata.
Although the `@AnyMetaDef` mapping could be set right next to the `@Any` annotation,
if you need to reuse it, it's good practice to configure it at the class or package level.
====

To see the `@Any` annotation in action, consider the next examples.
Expand Down

0 comments on commit 0d2fa6e

Please sign in to comment.