@Documented @Target(value={METHOD,FIELD}) @Retention(value=RUNTIME) public @interface AssociationInverseSide
This annotation is generally not needed, as inverse sides of associations should generally be inferred by the mapper.
For example, Hibernate ORM defines inverse sides using @OneToMany#mappedBy
, @OneToOne#mappedBy
, etc.,
and the Hibernate ORM mapper will register these inverse sides automatically.
Modifier and Type | Required Element and Description |
---|---|
ObjectPath |
inversePath |
Modifier and Type | Optional Element and Description |
---|---|
ContainerValueExtractorBeanReference[] |
extractors |
public abstract ObjectPath inversePath
public abstract ContainerValueExtractorBeanReference[] extractors
Map<EntityA, EntityB>
,
@AssociationInverseSide(extractors = @ContainerValueExtractorBeanReference(type = MapKeyExtractor.class))
would define the inverse side of the association for the map keys (of type EntityA),
while @AssociationInverseSide(extractors = @ContainerValueExtractorBeanReference(type = MapValueExtractor.class))
would define the inverse side of the association for the map values (of type EntityB).
By default, Hibernate Search will try to apply a set of extractors for common types
(Iterable
, Collection
, Optional
, ...)
* and use the first one that works.
To prevent Hibernate Search from applying any extractor, set this attribute to an empty array ({}
).Copyright © 2006-2018 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.