@Field @NumericField @FieldBridge(impl = BigDecimalNumericFieldBridge.class) public BigDecimal myValue; @Id
Class<?> fieldBridgeClass = bridgeAnn.impl(); if ( fieldBridgeClass == void.class ) { throw LOG.noImplementationClassInFieldBridge( appliedOnName ); throw LOG.noFieldBridgeInterfaceImplementedByFieldBridge( instanceClass.getName(), appliedOnName ); if ( bridgeAnn.params().length > 0 && ParameterizedBridge.class.isAssignableFrom( instanceClass ) ) { Map<String, String> params = ParameterAnnotationsReader.toNewMutableMap( bridgeAnn.params() ); ( (ParameterizedBridge) instance ).setParameterValues( params );
Class<?> fieldBridgeClass = bridgeAnn.impl(); if ( fieldBridgeClass == void.class ) { throw LOG.noImplementationClassInFieldBridge( appliedOnName ); throw LOG.noFieldBridgeInterfaceImplementedByFieldBridge( instanceClass.getName(), appliedOnName ); if ( bridgeAnn.params().length > 0 && ParameterizedBridge.class.isAssignableFrom( instanceClass ) ) { Map<String, String> params = ParameterAnnotationsReader.toNewMutableMap( bridgeAnn.params() ); ( (ParameterizedBridge) instance ).setParameterValues( params );
/** * @return the field bridge explicitly specified via {@code @Field.bridge} or {@code @FieldBridge}. {@code null} * is returned if none is present. */ private FieldBridge findExplicitFieldBridge(Field field, XMember member, ReflectionManager reflectionManager) { //TODO Should explicit FieldBridge also support the notion of container like numeric fields and provider based fields? // the main problem is that support for a bridge accepting a Map would break FieldBridge bridge = null; org.hibernate.search.annotations.FieldBridge bridgeAnnotation; //@Field bridge has priority over @FieldBridge if ( field != null && void.class != field.bridge().impl() ) { bridgeAnnotation = field.bridge(); } else { bridgeAnnotation = member.getAnnotation( org.hibernate.search.annotations.FieldBridge.class ); } if ( bridgeAnnotation != null ) { bridge = createFieldBridgeFromAnnotation( bridgeAnnotation, member.getName(), reflectionManager.toClass( member.getType() ) ); } return bridge; }
@Field @NumericField @FieldBridge(impl = BigDecimalNumericFieldBridge.class) public BigDecimal myValue; @Id
/** * @return the field bridge explicitly specified via {@code @Field.bridge} or {@code @FieldBridge}. {@code null} * is returned if none is present. */ private FieldBridge findExplicitFieldBridge(Field field, XMember member, ReflectionManager reflectionManager) { //TODO Should explicit FieldBridge also support the notion of container like numeric fields and provider based fields? // the main problem is that support for a bridge accepting a Map would break FieldBridge bridge = null; org.hibernate.search.annotations.FieldBridge bridgeAnnotation; //@Field bridge has priority over @FieldBridge if ( field != null && void.class != field.bridge().impl() ) { bridgeAnnotation = field.bridge(); } else { bridgeAnnotation = member.getAnnotation( org.hibernate.search.annotations.FieldBridge.class ); } if ( bridgeAnnotation != null ) { bridge = createFieldBridgeFromAnnotation( bridgeAnnotation, member.getName(), reflectionManager.toClass( member.getType() ) ); } return bridge; }
@FieldBridge public String getFoo() { return null; } }
@NotNull @Field(analyze = Analyze.NO) @FieldBridge(impl = ContentStateBridge.class) @Override @Nonnull public ContentState getState() { return state; }
@FieldBridge(impl = LongBridge.class) @Field(index=Index.YES, analyze=Analyze.NO, store=Store.NO) @Column(name = "qhb_publication_id", nullable = false) public long getQhbPublicationId() { return this.qhbPublicationId; }
@FieldBridge(impl = LongBridge.class) @Field(index = Index.YES, analyze = Analyze.NO, store = Store.NO) @Override public Long getId() { return id; }
@FieldBridge(impl = FloatBridge.class) @Field(index = Index.YES, analyze = Analyze.NO, store = Store.NO) @Override public float getScore() { return score; }
@FieldBridge(impl = LongBridge.class) @Field(index = Index.YES, analyze = Analyze.NO, store = Store.NO) @Override public Long getId() { return id; }
@FieldBridge(impl = LongBridge.class) @Field(index = Index.YES, analyze = Analyze.NO, store = Store.NO) @Override public Long getId() { return id; }
@OneToOne @JoinColumn(name = "srcLocaleId", nullable = false) @Field(analyze = Analyze.NO) @FieldBridge(impl = LocaleIdBridge.class) public HLocale getSrcLocale() { return srcLocale; }
@FieldBridge(impl = LongBridge.class) @Field(index=Index.YES, analyze=Analyze.NO, store=Store.NO) @Column(name = "rele_source_id", nullable = false) public long getReleSourceId() { return this.releSourceId; }
@Field(bridge = @FieldBridge(impl = MapKeyValueToCsvBridge.class) , index = Index.YES, analyze = Analyze.YES, store = Store.NO) @Override public Map<String, String> getParameters() { if (parameters == null) { parameters = new HashMap<>(); } return parameters; }
@Field @FieldBridge(impl = ResourcesBridge.class) @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "res_resource_id", nullable = false) public Resources getResources() { return this.resources; }
@Field(bridge = @FieldBridge(impl = EnumBridge.class) , index = Index.YES, analyze = Analyze.NO, store = Store.NO) @Override public DataContextType getType() { return type; }
@FieldBridge(impl = LongBridge.class) @Field(index=Index.YES, analyze=Analyze.NO, store=Store.NO) @Column(name = "qhb_query_id", nullable = false) public long getQhbQueryId() { return this.qhbQueryId; }