Este contenido no está disponible en el idioma seleccionado.

15.6. Annotating Objects and Storing Indexes


15.6.1. Annotating Objects for Infinispan Query

Once indexing has been enabled, custom objects being stored in JBoss Data Grid need to be assigned appropriate Infinispan Query annotations.
As a basic requirement, all objects required to be indexed must be annotated with
  • @Entity
  • @Indexed
  • @ProvidedId
In addition, all fields within the object that will be searched need to be annotated with @Field.
For example:
@Entity @ProvidedId @Indexed
public class Person
	implements Serializable {
		@Field(store = Store.YES)
		private String name;
		@Field(store = Store.YES)
		private String description;
		@Field(store = Store.YES)
		private int age;
...
}
Copy to Clipboard Toggle word wrap
For more useful annotations and options, refer to the JBoss Web Framework Kit Hibernate Search guide.

Important

The Query Module is currently only available as a Technical Preview for JBoss Data Grid 6.1.
Volver arriba
Red Hat logoGithubredditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar. Explore nuestras recientes actualizaciones.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

Theme

© 2025 Red Hat