
org.hibernate.search.annotations.ContainedIn Maven / Gradle / Ivy
/*
* Hibernate Search, full-text search for your domain model
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or .
*/
package org.hibernate.search.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.annotation.ElementType;
import java.lang.annotation.Documented;
/**
* Describe the owning entity as being part of the target entity's
* indexed object graph.
*
* Often used when an @Indexed class is used as a @IndexedEmbedded
* target class. @ContainedIn must mark the property pointing back
* to the @IndexedEmbedded owning Entity (not necessary if the class
* is an @Embeddable class).
*
* Also used to trigger a reindex of related entities even if no
* @IndexedEmbedded is involved, allowing to define a dependency
* graph.
*
*
* @Indexed
* public class OrderLine {
* @IndexedEmbedded
* private Order order;
* }
*
* @Indexed
* public class Order {
* @ContainedIn
* Set lines;
* }
*
*
* @see org.hibernate.search.annotations.Indexed
* @see org.hibernate.search.annotations.IndexedEmbedded
* @author Emmanuel Bernard
*/
@Retention( RetentionPolicy.RUNTIME )
@Target({ ElementType.FIELD, ElementType.METHOD })
@Documented
public @interface ContainedIn {
}