Package org.hibernate

Examples of org.hibernate.InvalidMappingException


    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

    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(XmlDocument metadataXml, Set<String> entityNames) {
      try {
        HbmBinder.bindRoot( metadataXml, createMappings(), Collections.EMPTY_MAP, entityNames );
      }
      catch ( MappingException me ) {
        throw new InvalidMappingException(
            metadataXml.getOrigin().getType(),
            metadataXml.getOrigin().getName(),
            me
        );
      }
View Full Code Here

        cfg.addInputStream( new BufferedInputStream( namedInputStream.getStream() ) );
      }
      catch ( InvalidMappingException e ) {
        // try our best to give the file name
        if ( StringHelper.isNotEmpty( namedInputStream.getName() ) ) {
          throw new InvalidMappingException(
              "Error while parsing file: " + namedInputStream.getName(),
              e.getType(),
              e.getPath(),
              e
          );
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

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.