<p>Could someone explain to me how Any-related annotations (<code>@Any</code>, <code>@AnyMetaDef</code>, <code>@AnyMetaDefs</code> and <code>@ManyToAny</code>) work in practice. I have a hard time finding any useful documentation (JavaDoc alone isn't very helpful) about these.</p>

<p>I have thus far gathered that they somehow enable referencing to abstract and extended classes. If this is the case, why is there not an <code>@OneToAny</code> annotation? And is this 'any' referring to a single 'any', or multiple 'any'?</p>

<p>A short, practical and illustrating example would be very much appreciated (doesn't have to compile).</p>

<p><strong>Edit:</strong> as much as I would like to accept replies as answers and give credit where due, I found both Smink's and Sakana's answers informative. Because I can't accept several replies as <em>the answer</em>, I will unfortunately mark neither as the answer.</p>

Have you read
the Hibernate Annotations documentation for @Any
? Haven't used that one myself yet, but it looks like some extended way of defining references. The link includes an example, though I don't know if it's enough to fully understand the concept...