Package org.hibernate

Examples of org.hibernate.InvalidMappingException


    private void processHbmXml(XmlDocument metadataXml, Set<String> entityNames) {
      try {
        HbmBinder.bindRoot( metadataXml, createMappings(), CollectionHelper.EMPTY_MAP, entityNames );
      }
      catch ( MappingException me ) {
        throw new InvalidMappingException(
            metadataXml.getOrigin().getType(),
            metadataXml.getOrigin().getName(),
            me
        );
      }
View Full Code Here


    try {
      add( url.openStream(), "URL", urlExternalForm );
    }
    catch ( IOException e ) {
      throw new InvalidMappingException( "Unable to open url stream [" + urlExternalForm + "]", "URL", urlExternalForm, e );
    }
    return this;
  }
View Full Code Here

    try {
      try {
        jarFile = new JarFile( jar );
      }
      catch (IOException ioe) {
        throw new InvalidMappingException(
            "Could not read mapping documents from jar: " + jar.getName(), "jar", jar.getName(),
            ioe
        );
      }
      Enumeration jarEntries = jarFile.entries();
      while ( jarEntries.hasMoreElements() ) {
        ZipEntry ze = (ZipEntry) jarEntries.nextElement();
        if ( ze.getName().endsWith( ".hbm.xml" ) ) {
          LOG.foundMappingDocument( ze.getName() );
          try {
            addInputStream( jarFile.getInputStream( ze ) );
          }
          catch (Exception e) {
            throw new InvalidMappingException(
                "Could not read mapping documents from jar: " + jar.getName(),
                "jar",
                jar.getName(),
                e
            );
View Full Code Here

          log.debug( "Problem parsing XML using orm 1 xsd : {}", orm1Problem.getMessage() );
          errorHandler.error = null;
        }
      }
    }
    throw new InvalidMappingException( "Unable to read XML", source.getOrigin().getType(), source.getOrigin().getName(), failure );

  }
View Full Code Here

    try {
      add( url.openStream(), "URL", urlExternalForm );
    }
    catch ( IOException e ) {
      throw new InvalidMappingException( "Unable to open url stream [" + urlExternalForm + "]", "URL", urlExternalForm, e );
    }
    return this;
  }
View Full Code Here

    try {
      try {
        jarFile = new JarFile( jar );
      }
      catch (IOException ioe) {
        throw new InvalidMappingException(
            "Could not read mapping documents from jar: " + jar.getName(), "jar", jar.getName(),
            ioe
        );
      }
      Enumeration jarEntries = jarFile.entries();
      while ( jarEntries.hasMoreElements() ) {
        ZipEntry ze = (ZipEntry) jarEntries.nextElement();
        if ( ze.getName().endsWith( ".hbm.xml" ) ) {
          log.info( "Found mapping document in jar: " + ze.getName() );
          try {
            addInputStream( jarFile.getInputStream( ze ) );
          }
          catch (Exception e) {
            throw new InvalidMappingException(
                "Could not read mapping documents from jar: " + jar.getName(),
                "jar",
                jar.getName(),
                e
            );
View Full Code Here

    private void processHbmXml(XMLHelper.MetadataXml metadataXml, Set<String> entityNames) {
      try {
        HbmBinder.bindRoot( metadataXml, createMappings(), CollectionHelper.EMPTY_MAP, entityNames );
      }
      catch ( MappingException me ) {
        throw new InvalidMappingException( metadataXml.getOriginType(), metadataXml.getOriginName(), me );
      }

      for ( String entityName : entityNames ) {
        if ( annotatedClassesByEntityNameMap.containsKey( entityName ) ) {
          annotatedClasses.remove( annotatedClassesByEntityNameMap.get( entityName ) );
View Full Code Here

            LOG.debugf( "Problem parsing XML using orm 1 xsd : %s", orm1Problem.getMessage() );
          }
        }
      }
    }
    throw new InvalidMappingException( "Unable to read XML", origin.getType(), origin.getName(), failure );
  }
View Full Code Here

    }
    try {
      List errors = new ArrayList();
      org.dom4j.Document doc = xmlHelper.createSAXReader( xmlFile.toString(), errors, entityResolver ).read( xmlFile );
      if ( errors.size() != 0 ) {
        throw new InvalidMappingException( "file", xmlFile.toString(), ( Throwable ) errors.get( 0 ) );
      }
      add( doc );
      return this;
    }
    catch ( InvalidMappingException e ) {
      throw e;
    }
    catch  ( MappingNotFoundException e ) {
      throw e;
    }
    catch ( Exception e ) {
      throw new InvalidMappingException( "file", xmlFile.toString(), e );
    }
  }
View Full Code Here

    }
    catch  ( MappingNotFoundException e ) {
      throw e;
    }
    catch ( Exception e ) {
      throw new InvalidMappingException( "file", xmlFile.toString(), e );
    }
  }
View Full Code Here

TOP

Related Classes of org.hibernate.InvalidMappingException

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.