Package org.hibernate

Examples of org.hibernate.InvalidMappingException


    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

    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 {
      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

    }
    try {
      addInputStream( url.openStream() );
    }
    catch ( InvalidMappingException e ) {
      throw new InvalidMappingException( "URL", url.toExternalForm(), e.getCause() );
    }
    catch (Exception e) {
      throw new InvalidMappingException( "URL", url.toExternalForm(), e );
    }
    return this;
  }
View Full Code Here

    try {
      List errors = new ArrayList();
      org.dom4j.Document doc = xmlHelper.createSAXReader( "XML InputStream", errors, entityResolver )
          .read( new InputSource( xmlInputStream ) );
      if ( errors.size() != 0 ) {
        throw new InvalidMappingException( "invalid mapping", null, (Throwable) errors.get( 0 ) );
      }
      add( doc );
      return this;
    }
    catch (DocumentException e) {
      throw new InvalidMappingException( "input stream", null, e );
    }
    finally {
      try {
        xmlInputStream.close();
      }
View Full Code Here

    }
    try {
      return addInputStream( rsrc );
    }
    catch (MappingException me) {
      throw new InvalidMappingException( "resource", resourceName, me );
    }
  }
View Full Code Here

    }
    try {
      return addInputStream( rsrc );
    }
    catch (MappingException me) {
      throw new InvalidMappingException( "resource", resourceName, me );
    }
  }
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

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.