Examples of DocumentId


Examples of org.hibernate.search.annotations.DocumentId

   */
  private Annotation getIdAnnotation(XProperty member, ConfigContext context) {
    Annotation idAnnotation = null;

    // check for explicit DocumentId
    DocumentId documentIdAnn = member.getAnnotation( DocumentId.class );
    if ( documentIdAnn != null ) {
      idAnnotation = documentIdAnn;
    }
    // check for JPA @Id
    else if ( context.isJpaPresent() ) {
View Full Code Here

Examples of org.hibernate.search.annotations.DocumentId

  }

  private void initializeMember(XProperty member, PropertiesMetadata propertiesMetadata, boolean isRoot,
                  String prefix, Set<XClass> processedClasses) {

    DocumentId documentIdAnn = member.getAnnotation( DocumentId.class );
    if ( documentIdAnn != null ) {
      if ( isRoot ) {
        if ( idKeywordName != null ) {
          throw new AssertionFailure( "Two document id assigned: "
              + idKeywordName + " and " + BinderHelper.getAttributeName( member, documentIdAnn.name() ) );
        }
        idKeywordName = prefix + BinderHelper.getAttributeName( member, documentIdAnn.name() );
        FieldBridge fieldBridge = BridgeFactory.guessType( null, member, reflectionManager );
        if ( fieldBridge instanceof TwoWayFieldBridge ) {
          idBridge = (TwoWayFieldBridge) fieldBridge;
        }
        else {
          throw new SearchException(
              "Bridge for document id does not implement TwoWayFieldBridge: " + member.getName() );
        }
        idBoost = getBoost( member );
        setAccessible( member );
        idGetter = member;
      }
      else {
        //component should index their document id
        setAccessible( member );
        propertiesMetadata.fieldGetters.add( member );
        String fieldName = prefix + BinderHelper.getAttributeName( member, documentIdAnn.name() );
        propertiesMetadata.fieldNames.add( fieldName );
        propertiesMetadata.fieldStore.add( getStore( Store.YES ) );
        propertiesMetadata.fieldIndex.add( getIndex( Index.UN_TOKENIZED ) );
        propertiesMetadata.fieldBridges.add( BridgeFactory.guessType( null, member, reflectionManager ) );
        // Field > property > entity analyzer
View Full Code Here

Examples of org.hibernate.search.annotations.DocumentId

   */
  private Annotation getIdAnnotation(XProperty member, ConfigContext context) {
    Annotation idAnnotation = null;

    // check for explicit DocumentId
    DocumentId documentIdAnn = member.getAnnotation( DocumentId.class );
    if ( documentIdAnn != null ) {
      idAnnotation = documentIdAnn;
      documentIdAnnotatedMember = member;
    }
    // check for JPA @Id
View Full Code Here

Examples of org.hibernate.search.annotations.DocumentId

  private void checkForField(XClass classHostingMember, XProperty member, PropertiesMetadata propertiesMetadata, String prefix, ConfigContext context, PathsContext pathsContext) {
    org.hibernate.search.annotations.Field fieldAnn =
        member.getAnnotation( org.hibernate.search.annotations.Field.class );
    NumericField numericFieldAnn = member.getAnnotation( NumericField.class );
    DocumentId idAnn = member.getAnnotation( DocumentId.class );
    if ( fieldAnn != null ) {
      if ( isFieldInPath( fieldAnn, member, pathsContext, prefix ) || level <= maxLevel ) {
        bindFieldAnnotation( classHostingMember, member, propertiesMetadata, prefix, fieldAnn, numericFieldAnn, context );
      }
    }
View Full Code Here

Examples of org.hibernate.search.annotations.DocumentId

   */
  private Annotation getIdAnnotation(XProperty member, TypeMetadata.Builder typeMetadataBuilder, ConfigContext context) {
    Annotation idAnnotation = null;

    // check for explicit DocumentId
    DocumentId documentIdAnnotation = member.getAnnotation( DocumentId.class );
    if ( documentIdAnnotation != null ) {
      idAnnotation = documentIdAnnotation;
    }
    // check for JPA @Id
    if ( context.isJpaPresent() ) {
View Full Code Here

Examples of org.hibernate.search.annotations.DocumentId

      ParseContext parseContext) {

    org.hibernate.search.annotations.Field fieldAnnotation =
        member.getAnnotation( org.hibernate.search.annotations.Field.class );
    NumericField numericFieldAnnotation = member.getAnnotation( NumericField.class );
    DocumentId idAnn = member.getAnnotation( DocumentId.class );
    if ( fieldAnnotation != null ) {
      if ( isFieldInPath( fieldAnnotation, member, pathsContext, prefix ) || !parseContext.isMaxLevelReached() ) {
        PropertyMetadata.Builder propertyMetadataBuilder = new PropertyMetadata.Builder( member )
            .dynamicBoostStrategy( AnnotationProcessingHelper.getDynamicBoost( member ) );
View Full Code Here

Examples of org.hibernate.search.annotations.DocumentId

   */
  private Annotation getIdAnnotation(XProperty member, ConfigContext context) {
    Annotation idAnnotation = null;

    // check for explicit DocumentId
    DocumentId documentIdAnn = member.getAnnotation( DocumentId.class );
    if ( documentIdAnn != null ) {
      idAnnotation = documentIdAnn;
      documentIdAnnotatedMember = member;
    }
    // check for JPA @Id
View Full Code Here

Examples of org.hibernate.search.annotations.DocumentId

  private void checkForField(XProperty member, PropertiesMetadata propertiesMetadata, String prefix, ConfigContext context) {
    org.hibernate.search.annotations.Field fieldAnn =
        member.getAnnotation( org.hibernate.search.annotations.Field.class );
    NumericField numericFieldAnn = member.getAnnotation( NumericField.class );
    DocumentId idAnn = member.getAnnotation( DocumentId.class );
    if ( fieldAnn != null ) {
      bindFieldAnnotation( member, propertiesMetadata, prefix, fieldAnn, numericFieldAnn, context );
    }
    if ( ( fieldAnn == null && idAnn == null ) && numericFieldAnn != null ) {
      throw new SearchException( "@NumericField without a @Field on property '" + member.getName() + "'" );
View Full Code Here

Examples of org.hibernate.search.annotations.DocumentId

   */
  private Annotation getIdAnnotation(XProperty member, ConfigContext context) {
    Annotation idAnnotation = null;

    // check for explicit DocumentId
    DocumentId documentIdAnn = member.getAnnotation( DocumentId.class );
    if ( documentIdAnn != null ) {
      idAnnotation = documentIdAnn;
    }
    // check for JPA @Id
    else if ( context.isJpaPresent() ) {
View Full Code Here

Examples of org.hibernate.search.annotations.DocumentId

  private void checkForField(XClass classHostingMember, XProperty member, PropertiesMetadata propertiesMetadata,
      String prefix, ConfigContext context) {
    org.hibernate.search.annotations.Field fieldAnn =
        member.getAnnotation( org.hibernate.search.annotations.Field.class );
    NumericField numericFieldAnn = member.getAnnotation( NumericField.class );
    DocumentId idAnn = member.getAnnotation( DocumentId.class );
    if ( fieldAnn != null ) {
      bindFieldAnnotation( classHostingMember, member, propertiesMetadata, prefix, fieldAnn, numericFieldAnn, context );
    }
    if ( ( fieldAnn == null && idAnn == null ) && numericFieldAnn != null ) {
      throw new SearchException( "@NumericField without a @Field on property '" + member.getName() + "'" );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.