Package org.hibernate

Examples of org.hibernate.InvalidMappingException


    }
    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

        staxEventReader.nextEvent();
        event = staxEventReader.peek();
      }
    }
    catch ( Exception e ) {
      throw new InvalidMappingException( "Error accessing stax stream", origin, e );
    }

    if ( event == null ) {
      throw new InvalidMappingException( "Could not locate root element", origin );
    }

    final String rootElementName = event.asStartElement().getName().getLocalPart();

    if ( "entity-mappings".equals( rootElementName ) ) {
View Full Code Here

      };

      return dom4jStaxEventReader.readDocument( staxEventReader );
    }
    catch (XMLStreamException e) {
      throw new InvalidMappingException( "Unable to read StAX source as dom4j Document for processing", origin, e );
    }
  }
View Full Code Here

    final StAXSource staxSource;
    try {
      staxSource = new StAXSource( staxEventReader );
    }
    catch (XMLStreamException e) {
      throw new InvalidMappingException( "Unable to generate StAXSource from mapping", origin, e );
    }

    try {
      validator.validate( staxSource );
    }
    catch (SAXException e) {
      throw new InvalidMappingException( "SAXException performing validation", origin, e );
    }
    catch (IOException e) {
      throw new InvalidMappingException( "IOException performing validation", origin, e );
    }
  }
View Full Code Here

            }
          }
        }
      }
    }
    throw new InvalidMappingException( "Unable to read XML", origin.getType(), origin.getName(), failure );
  }
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

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

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.