Package org.hibernate.internal.util.xml

Examples of org.hibernate.internal.util.xml.XmlDocument


  private XmlDocument add(InputSource inputSource, String originType, String originName) {
    return add( inputSource, new OriginImpl( originType, originName ) );
  }

  private XmlDocument add(InputSource inputSource, Origin origin) {
    XmlDocument metadataXml = MappingReader.INSTANCE.readMappingDocument( entityResolver, inputSource, origin );
    add( metadataXml );
    return metadataXml;
  }
View Full Code Here


    catch ( FileNotFoundException e ) {
      throw new MappingNotFoundException( "file", xmlFile.toString() );
    }

        LOG.readingMappingsFromFile(xmlFile.getPath());
    XmlDocument metadataXml = add( inputSource, "file", name );

    try {
            LOG.debugf("Writing cache file for: %s to: %s", xmlFile, cachedFile);
      SerializationHelper.serialize( ( Serializable ) metadataXml.getDocumentTree(), new FileOutputStream( cachedFile ) );
        } catch (Exception e) {
            LOG.unableToWriteCachedFile(cachedFile.getPath(), e.getMessage());
    }

    return this;
View Full Code Here

  private XmlDocument add(InputSource inputSource, String originType, String originName) {
    return add( inputSource, new OriginImpl( originType, originName ) );
  }

  private XmlDocument add(InputSource inputSource, Origin origin) {
    XmlDocument metadataXml = MappingReader.INSTANCE.readMappingDocument( entityResolver, inputSource, origin );
    add( metadataXml );
    return metadataXml;
  }
View Full Code Here

    catch ( FileNotFoundException e ) {
      throw new MappingNotFoundException( "file", xmlFile.toString() );
    }

    LOG.readingMappingsFromFile( xmlFile.getPath() );
    XmlDocument metadataXml = add( inputSource, "file", name );

    try {
      LOG.debugf( "Writing cache file for: %s to: %s", xmlFile, cachedFile );
      SerializationHelper.serialize( ( Serializable ) metadataXml.getDocumentTree(), new FileOutputStream( cachedFile ) );
    }
    catch ( Exception e ) {
      LOG.unableToWriteCachedFile( cachedFile.getPath(), e.getMessage() );
    }
View Full Code Here

                LOG.unableToResolveMappingFile(xmlFile);
        continue;
      }
      final InputSource inputSource = new InputSource( fileInputStream );

      XmlDocument metadataXml = MappingReader.INSTANCE.readMappingDocument(
          cfg.getEntityResolver(),
          inputSource,
          new OriginImpl( "persistence-unit-info", xmlFile )
      );
      xmlDocuments.add( metadataXml );
      try {
        final Element rootElement = metadataXml.getDocumentTree().getRootElement();
        if ( rootElement != null && "entity-mappings".equals( rootElement.getName() ) ) {
          Element element = rootElement.element( "package" );
          String defaultPackage = element != null ? element.getTextTrim() : null;
          List<Element> elements = rootElement.elements( "entity" );
          for (Element subelement : elements ) {
View Full Code Here

                LOG.unableToResolveMappingFile(xmlFile);
        continue;
      }
      final InputSource inputSource = new InputSource( fileInputStream );

      XmlDocument metadataXml = MappingReader.INSTANCE.readMappingDocument(
          cfg.getEntityResolver(),
          inputSource,
          new OriginImpl( "persistence-unit-info", xmlFile )
      );
      xmlDocuments.add( metadataXml );
      try {
        final Element rootElement = metadataXml.getDocumentTree().getRootElement();
        if ( rootElement != null && "entity-mappings".equals( rootElement.getName() ) ) {
          Element element = rootElement.element( "package" );
          String defaultPackage = element != null ? element.getTextTrim() : null;
          List<Element> elements = rootElement.elements( "entity" );
          for (Element subelement : elements ) {
View Full Code Here

                LOG.unableToResolveMappingFile(xmlFile);
        continue;
      }
      final InputSource inputSource = new InputSource( fileInputStream );

      XmlDocument metadataXml = MappingReader.INSTANCE.readMappingDocument(
          cfg.getEntityResolver(),
          inputSource,
          new OriginImpl( "persistence-unit-info", xmlFile )
      );
      xmlDocuments.add( metadataXml );
      try {
        final Element rootElement = metadataXml.getDocumentTree().getRootElement();
        if ( rootElement != null && "entity-mappings".equals( rootElement.getName() ) ) {
          Element element = rootElement.element( "package" );
          String defaultPackage = element != null ? element.getTextTrim() : null;
          List<Element> elements = rootElement.elements( "entity" );
          for (Element subelement : elements ) {
View Full Code Here

  private XmlDocument add(InputSource inputSource, String originType, String originName) {
    return add( inputSource, new OriginImpl( originType, originName ) );
  }

  private XmlDocument add(InputSource inputSource, Origin origin) {
    XmlDocument metadataXml = MappingReader.INSTANCE.readMappingDocument( entityResolver, inputSource, origin );
    add( metadataXml );
    return metadataXml;
  }
View Full Code Here

    catch ( FileNotFoundException e ) {
      throw new MappingNotFoundException( "file", xmlFile.toString() );
    }

    LOG.readingMappingsFromFile( xmlFile.getPath() );
    XmlDocument metadataXml = add( inputSource, "file", name );

    try {
      LOG.debugf( "Writing cache file for: %s to: %s", xmlFile, cachedFile );
      SerializationHelper.serialize( ( Serializable ) metadataXml.getDocumentTree(), new FileOutputStream( cachedFile ) );
    }
    catch ( Exception e ) {
      LOG.unableToWriteCachedFile( cachedFile.getPath(), e.getMessage() );
    }
View Full Code Here

  private XmlDocument add(InputSource inputSource, String originType, String originName) {
    return add( inputSource, new OriginImpl( originType, originName ) );
  }

  private XmlDocument add(InputSource inputSource, Origin origin) {
    XmlDocument metadataXml = MappingReader.INSTANCE.readMappingDocument( entityResolver, inputSource, origin );
    add( metadataXml );
    return metadataXml;
  }
View Full Code Here

TOP

Related Classes of org.hibernate.internal.util.xml.XmlDocument

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.