Package org.hibernate

Examples of org.hibernate.AnnotationException


      String propertyName,
      String suffixForDefaultColumnName,
      Mappings mappings) {
    if ( ann != null ) {
      if ( BinderHelper.isEmptyAnnotationValue( mappedBy ) ) {
        throw new AnnotationException(
            "Illegal attempt to define a @JoinColumn with a mappedBy association: "
                + BinderHelper.getRelativePath( propertyHolder, propertyName )
        );
      }
      Ejb3JoinColumn joinColumn = new Ejb3JoinColumn();
View Full Code Here


    this.propertyHolder = PropertyHolderBuilder.buildPropertyHolder( persistentClass, joins, getMappings(), inheritanceStatePerClass );
  }

  public static void checkIfJoinColumn(Object columns, PropertyHolder holder, PropertyData property) {
    if ( !( columns instanceof Ejb3JoinColumn[] ) ) {
      throw new AnnotationException(
          "@Column cannot be used on an association property: "
              + holder.getEntityName()
              + "."
              + property.getPropertyName()
      );
View Full Code Here

    for ( XProperty property : xprops.values() ) {
      if ( !property.isTypeResolved() && !discoverTypeWithoutReflection( property ) ) {
        String msg = "Property " + StringHelper.qualify( xClass.getName(), property.getName() ) +
            " has an unbound type and no explicit target entity. Resolve this Generic usage issue" +
            " or set an explicit target attribute (eg @OneToMany(target=) or use an explicit @Type";
        throw new AnnotationException( msg );
      }
    }
  }
View Full Code Here

    else if ( p.isAnnotationPresent( org.hibernate.annotations.Any.class ) ) {
      return true;
    }
    else if ( p.isAnnotationPresent( ManyToAny.class ) ) {
      if ( !p.isCollection() && !p.isArray() ) {
        throw new AnnotationException( "@ManyToAny used on a non collection non array property: " + p.getName() );
      }
      return true;
    }
    else if ( p.isAnnotationPresent( Type.class ) ) {
      return true;
View Full Code Here

        );
        idPropertyCount += currentIdPropertyCount;
      }

      if ( idPropertyCount == 0 && !inheritanceState.hasParents() ) {
        throw new AnnotationException( "No identifier specified for entity: " + clazz.getName() );
      }
      elementsToProcess = new ElementsToProcess( elements, idPropertyCount );
    }
    return elementsToProcess;
  }
View Full Code Here

          }
        }
      }
      xclass = xclass.getSuperclass();
    }
    throw new AnnotationException( "No identifier specified for entity: " + clazz );
  }
View Full Code Here

                  this.getClass()
              )
          );
        }
        catch ( ClassNotFoundException e ) {
          throw new AnnotationException(
              "Unable to find " + element.getPath() + ".class: " + className, e
          );
        }
      }
      AnnotationDescriptor ad = new AnnotationDescriptor( EntityListeners.class );
View Full Code Here

        clazz = ReflectHelper.classForName(
            XMLContext.buildSafeClassName( className, defaults ), this.getClass()
        );
      }
      catch ( ClassNotFoundException e ) {
        throw new AnnotationException(
            "Unable to find " + element.getPath() + " " + nodeName + ": " + className, e
        );
      }
      ad.setValue( getJavaAttributeNameFromXMLOne( nodeName ), clazz );
    }
View Full Code Here

              XMLContext.buildSafeClassName( mapKeyClassName, defaults ),
              this.getClass()
          );
        }
        catch ( ClassNotFoundException e ) {
          throw new AnnotationException(
              "Unable to find " + element.getPath() + " " + nodeName + ": " + mapKeyClassName, e
          );
        }
        ad.setValue( "value", clazz );
      }
View Full Code Here

      }
      else if ( "STRING".equalsIgnoreCase( enumerated ) ) {
        ad.setValue( "value", EnumType.STRING );
      }
      else if ( StringHelper.isNotEmpty( enumerated ) ) {
        throw new AnnotationException( "Unknown EnumType: " + enumerated + ". " + SCHEMA_VALIDATION );
      }
      annotationList.add( AnnotationFactory.create( ad ) );
    }
  }
View Full Code Here

TOP

Related Classes of org.hibernate.AnnotationException

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.