Examples of AnnotationException


Examples of org.hibernate.AnnotationException

      for ( Column column : unboundNoLogical ) {
        sb.append( column.getName() ).append( ", " );
      }
      sb.setLength( sb.length() - 2 );
      sb.append( " not found. Make sure that you use the correct column name which depends on the naming strategy in use (it may not be the same as the property name in the entity, especially for relational types)" );
      throw new AnnotationException( sb.toString() );
    }
  }
View Full Code Here

Examples of org.hibernate.AnnotationException

      return classes;
    }

    public void addAnyMetaDef(AnyMetaDef defAnn) throws AnnotationException {
      if ( anyMetaDefs.containsKey( defAnn.name() ) ) {
        throw new AnnotationException( "Two @AnyMetaDef with the same name defined: " + defAnn.name() );
      }
      anyMetaDefs.put( defAnn.name(), defAnn );
    }
View Full Code Here

Examples of org.hibernate.AnnotationException

    return mappedSuperclassAnnotation != null;
  }

  private static void assertNotEntityAndMappedSuperClass(AnnotationInstance jpaEntityAnnotation, AnnotationInstance mappedSuperClassAnnotation, String className) {
    if ( jpaEntityAnnotation != null && mappedSuperClassAnnotation != null ) {
      throw new AnnotationException(
          "An entity cannot be annotated with both @Entity and @MappedSuperclass. " + className + " has both annotations."
      );
    }
  }
View Full Code Here

Examples of org.hibernate.AnnotationException

    }
  }

  private static void assertNotEntityAndEmbeddable(AnnotationInstance jpaEntityAnnotation, AnnotationInstance embeddableAnnotation, String className) {
    if ( jpaEntityAnnotation != null && embeddableAnnotation != null ) {
      throw new AnnotationException(
          "An entity cannot be annotated with both @Entity and @Embeddable. " + className + " has both annotations."
      );
    }
  }
View Full Code Here

Examples of org.hibernate.AnnotationException

      }
      else if ( annotation.target() instanceof MethodInfo ) {
        tmpAccessType = AccessType.PROPERTY;
      }
      else {
        throw new AnnotationException( "Invalid placement of @Id annotation" );
      }

      if ( accessType == null ) {
        accessType = tmpAccessType;
      }
      else {
        if ( !accessType.equals( tmpAccessType ) ) {
          throw new AnnotationException( "Inconsistent placement of @Id annotation within hierarchy " );
        }
      }
    }
    return accessType;
  }
View Full Code Here

Examples of org.hibernate.AnnotationException

      }
      inheritanceAnnotation = JandexHelper.getSingleAnnotation(
          info, JPADotNames.INHERITANCE
      );
      if ( inheritanceAnnotation != null ) {
        throw new AnnotationException(
            String.format(
                "The inheritance type for %s must be specified on the root entity %s",
                hierarchyListString( classes ),
                rootClassInfo.name().toString()
            )
View Full Code Here

Examples of org.hibernate.AnnotationException

  private static AccessType throwIdNotFoundAnnotationException(List<ClassInfo> classes) {
    StringBuilder builder = new StringBuilder();
    builder.append( "Unable to determine identifier attribute for class hierarchy consisting of the classe(s) " );
    builder.append( hierarchyListString( classes ) );
    throw new AnnotationException( builder.toString() );
  }
View Full Code Here

Examples of org.hibernate.AnnotationException

              "with @Embeddable. Are all annotated classes added to the configuration?",
          getConfiguredClass().getSimpleName(),
          attributeName,
          type.getSimpleName()
      );
      throw new AnnotationException( msg );
    }

    localBindingContext.resolveAllTypes( type.getName() );
    EmbeddableHierarchy hierarchy = EmbeddableHierarchy.createEmbeddableHierarchy(
        localBindingContext.<Object>locateClassByName( embeddableClassInfo.toString() ),
View Full Code Here

Examples of org.hibernate.AnnotationException

    }
    else if ( discoveredAttributeTypes.size() == 1 ) {
      return discoveredAttributeTypes.keySet().iterator().next();
    }
    else {
      throw new AnnotationException( "More than one association type configured for property  " + getName() + " of class " + getName() );
    }
  }
View Full Code Here

Examples of org.hibernate.AnnotationException

      for ( String className : classNames ) {
        try {
          metadataSourceQueue.add( reflectionManager.classForName( className, this.getClass() ) );
        }
        catch ( ClassNotFoundException e ) {
          throw new AnnotationException( "Unable to load class defined in XML: " + className, e );
        }
      }
    }
  }
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.