Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HSEARCH-3609 Move binder references out of @ValueBridgeRef and @Ident…
…ifierBridgeRef to different annotations Now that some bridges can only be referenced by their binder, this makes more sense.
- Loading branch information
Showing
24 changed files
with
224 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
.../java/org/hibernate/search/mapper/pojo/bridge/mapping/annotation/IdentifierBinderRef.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* 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 <http://www.gnu.org/licenses/lgpl-2.1.html>. | ||
*/ | ||
package org.hibernate.search.mapper.pojo.bridge.mapping.annotation; | ||
|
||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
import org.hibernate.search.mapper.pojo.bridge.mapping.programmatic.IdentifierBinder; | ||
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.DocumentId; | ||
|
||
/** | ||
* References the identifier binder to use for a {@link DocumentId}. | ||
* <p> | ||
* Either a bridge or a binder can be referenced, but never both. | ||
* References can use either a name, a type, or both. | ||
*/ | ||
@Documented | ||
@Target({}) // Only used as a component in other annotations | ||
@Retention(RetentionPolicy.RUNTIME) | ||
public @interface IdentifierBinderRef { | ||
|
||
/** | ||
* Reference an identifier binder by its bean name. | ||
* @return The bean name of the identifier binder. | ||
*/ | ||
String name() default ""; | ||
|
||
/** | ||
* Reference an identifier binder by its type. | ||
* @return The type of the identifier binder. | ||
*/ | ||
Class<? extends IdentifierBinder> type() default UndefinedBinderImplementationType.class; | ||
|
||
/** | ||
* Class used as a marker for the default value of the {@link #type()} attribute. | ||
*/ | ||
abstract class UndefinedBinderImplementationType implements IdentifierBinder { | ||
private UndefinedBinderImplementationType() { | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.