@Target(value=TYPE) @Retention(value=RUNTIME) public @interface HierarchyScanStrategy
Entity-annotated classes and
In addition, properties will also be scanned for on
By default, the mapper will transparently scan all parent classes and interfaces. The closer in proximity a type is to the base type, the more precedence it is given when scanning. In addition, parent classes are given precedence over interfaces.
For entities, this enables polymorphic mapping of a class hierarchy into different CQL tables or UDTs.
For DAOs, this enables sharing configuration between DAOs by implementing an interface that has annotations defining how the DAO methods should behave.
To disable scanning, set
To control the highest ancestor considered in scanning for annotations, use
|Modifier and Type||Optional Element and Description|
Whether or not to include the specified
Whether or not ancestors should be scanned for properties and annotations.
public abstract Class<?> highestAncestor
Classto consider the highest ancestor, meaning the classes that this class extends or implements will not be scanned for annotations.
Note that If you have a complex hierarchy involving both parent classes and interfaces and highestAncestor specifies a class for example, all interfaces will still be included. Therefore it is recommended to avoid creating complex type hierarchies or to only do so if you expect the entire hierarchy to be scanned.
public abstract boolean includeHighestAncestor
Defaults to false.
Copyright © 2017–2021. All rights reserved.