Package org.hibernate.search.annotations

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


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

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

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

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

   */
  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

      textGetters.add( member );
      textNames.add( BinderHelper.getAttributeName( member, textAnn.name() ) );
      textBridges.add( BridgeFactory.guessType( member ) );
    }

    DocumentId documentIdAnn = member.getAnnotation( DocumentId.class );
    if ( documentIdAnn != null ) {
      if ( idKeywordName != null ) {
        throw new AssertionFailure( "Two document id assigned: "
            + idKeywordName + " and " + BinderHelper.getAttributeName( member, documentIdAnn.name() ) );
      }
      idKeywordName = BinderHelper.getAttributeName( member, documentIdAnn.name() );
      FieldBridge fieldBridge = BridgeFactory.guessType( member );
      if ( fieldBridge instanceof TwoWayFieldBridge ) {
        idBridge = (TwoWayFieldBridge) fieldBridge;
      }
      else {
View Full Code Here

  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

   */
  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

  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

   */
  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

  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

TOP

Related Classes of org.hibernate.search.annotations.DocumentId

Copyright © 2018 www.massapicom. 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.