You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/src/main/asciidoc/public/reference/_static-metamodel-overview.adoc
+5-5
Original file line number
Diff line number
Diff line change
@@ -6,15 +6,15 @@
6
6
include::../components/_incubating-warning.adoc[]
7
7
8
8
The static metamodel class describes the index structure. Each indexed entity (index) is represented by a single class
9
-
that may contain inner classes describing the embeddables (i.e. nested/flattened objects). These classes contain <<static-metamodel-processor-field-reference-types,field references>>
9
+
that may contain inner classes describing object fields (e.g. from <<mapping-indexedembedded,indexed-embedded properties>>). These classes contain <<static-metamodel-processor-field-reference-types,field references>>
10
10
representing index fields and their search capabilities.
11
11
12
12
The name of this root class is constructed from the indexed entity name by adding `pass:[__]` (two underscores) suffix, e.g. `MySearchEntitypass:[__]`.
13
13
If the indexed entity is a (static) inner class, then all the owning classes will be part of the name delimited with a `pass:[_]` (single underscore),
14
14
e.g. `MyOuterClasspass:[_]MySearchEntitypass:[__]`.
15
15
These classes are created in the same package where the search entity they represent is located.
16
16
17
-
The root metamodel class that describes the indexed entity has a static field `INDEX` that users can use to interact with the metamodel.
17
+
The root metamodel class that describes the indexed entity has a static field `INDEX` that you can use to interact with the metamodel.
18
18
It serves two primary purposes:
19
19
20
20
* It simplifies creating the search scope and building search queries for such scope.
@@ -39,15 +39,15 @@ limit acceptable field references to the ones obtained from the `Book__.INDEX`
39
39
40
40
A field reference type describes the set of search capabilities a particular index field has, in particular,
41
41
what kind of projections/aggregations/predicates/sorts are allowed, if any. It does so by implementing a
42
-
subset of search traits interfaces defined in `org.hibernate.search.engine.search.reference.pass:[*]`, which in turn allows
42
+
subset of <<mapping-inspect-traits,search "trait">> interfaces defined in `org.hibernate.search.engine.search.reference.pass:[*]`, which in turn allows
43
43
performing compile-time checks when building <<search-dsl,search queries>>.
@@ -42,12 +42,13 @@ The annotation processor has to be added to the build, e.g. for Maven:
42
42
----
43
43
44
44
<1> Provide the fully qualified class name of the annotation processor that generates the metamodel.
45
-
<2> Add the `org.hibernate.search:hibernate-search-metamodel-processor` dependency as an annotation processor path for the Maven compiler plugin to be able to actually find the processor.
46
-
<3> Add the backend dependency, in this example, the <<backend-lucene,Lucene backend>>, as an annotation processor path.
45
+
<2> Add the `org.hibernate.search:hibernate-search-processor` dependency to the annotation processor path (a superset of the compile path), so the Java compiler can find the processor.
46
+
<3> Add the backend dependency, in this example, the <<backend-lucene,Lucene backend>>, to the annotation processor path.
47
47
It is important to include the same backend that the application is using to make sure that the generated metamodel classes reflect all the backend specifics.
48
-
For example, backends might have different defaults, resulting in a different set of field traits depending on the backend.
48
+
For example, backends might have different defaults, resulting in a different set of <<mapping-inspect-traits,search traits>> per specific field, depending on the backend.
49
49
50
-
NOTE: The version of both annotation processor and backend dependencies are skipped in the definition of the annotation paths, as in case the Hibernate Search BOM is imported via dependency management, the compiler plugin will use the managed versions.
50
+
NOTE: The version of both annotation processor and backend dependencies can be ommitted in the definition of the annotation paths,
51
+
because they are defined in the Hibernate Search BOM, which we recommend you import via dependency management.
51
52
This way the generated metamodel classes will be based on the same backend that the application uses.
52
53
====
53
54
@@ -66,7 +67,7 @@ The annotation processor options are passed as the compiler arguments with the `
Explicitly define the backend version. By default, the processor will use the latest compatible version of the backend.
103
104
This option can be used if the static metamodel is required for an older backend version.
105
+
While this option is mostly for the Elasticsearch backend,
106
+
where it translates into <<configuration-properties-aggregated-hibernate-search-backend-elasticsearchhibernate.search.backend.version,`hibernate.search.backend.version`>>,
107
+
it will also translate into <<configuration-properties-aggregated-hibernate-search-backend-lucenehibernate.search.backend.lucene_version,`hibernate.search.backend.lucene_version`>> if the Lucene backend is used.
104
108
Default value:::
105
109
`<latest>`
106
110
107
111
[[static-metamodel-processor-limitations]]
108
112
== Current annotation processor limitations
109
113
110
-
While the annotation processor is in its early stages of development, it has a few limitations:
114
+
While the annotation processor is very much functional and we encourage you to try it,
115
+
it is still in the early stages of development, and thus has a few limitations:
111
116
112
117
* Any use of <<binding-valuebridge-valuebinder,custom binders>> will be ignored and should produce a compiler warning.
113
118
This means that if the search entities rely on custom binders, fields that those binders produce will be missing from the generated metamodel.
114
-
* <<mapper-orm-custom-annotations,Custom mapping annotations>> are not supported.
119
+
* <<mapper-orm-custom-annotations,Custom mapping annotations>> are ignored without warning.
115
120
* <<mapping-programmatic,Programmatic mapping>> is also unsupported by the annotation processor.
116
-
As the annotation processor cannot easily read programmatic mapping definitions, this limitation is here to stay.
121
+
As the annotation processor cannot possibly execute programmatic mapping defined in the code that is being compiled,
Copy file name to clipboardExpand all lines: documentation/src/test/java/org/hibernate/search/documentation/search/converter/ProjectionConverterIT.java
+1-1
Original file line number
Diff line number
Diff line change
@@ -165,7 +165,7 @@ public void setStatus(OrderStatus status) {
0 commit comments