Package org.hibernate

Examples of org.hibernate.MappingNotFoundException


   */
  public Configuration addResource(String resourceName, ClassLoader classLoader) throws MappingException {
    log.info( "Reading mappings from resource: " + resourceName );
    InputStream rsrc = classLoader.getResourceAsStream( resourceName );
    if ( rsrc == null ) {
      throw new MappingNotFoundException( "resource", resourceName );
    }
    try {
      return addInputStream( rsrc );
    }
    catch (MappingException me) {
View Full Code Here


    }
    if ( rsrc == null ) {
      rsrc = Environment.class.getClassLoader().getResourceAsStream( resourceName );
    }
    if ( rsrc == null ) {
      throw new MappingNotFoundException( "resource", resourceName );
    }
    try {
      return addInputStream( rsrc );
    }
    catch (MappingException me) {
View Full Code Here

   * the specified mapping file.
   */
  public Configuration addFile(File xmlFile) throws MappingException {
    log.info( "Reading mappings from file: " + xmlFile.getPath() );
    if ( !xmlFile.exists() ) {
      throw new MappingNotFoundException( "file", xmlFile.toString() );
    }
    try {
      List errors = new ArrayList();
      org.dom4j.Document doc = xmlHelper.createSAXReader( xmlFile.toString(), errors, entityResolver ).read( xmlFile );
      if ( errors.size() != 0 ) {
View Full Code Here

    catch ( FileNotFoundException e ) {
      log.warn( "I/O reported cached file could not be found : " + cachedFile.getPath() + " : " + e );
    }

    if ( !xmlFile.exists() ) {
      throw new MappingNotFoundException( "file", xmlFile.toString() );
    }

    log.info( "Reading mappings from file: " + xmlFile );
    List errors = new ArrayList();
    try {
View Full Code Here

   */
  public Configuration addResource(String resourceName, ClassLoader classLoader) throws MappingException {
    log.info( "Reading mappings from resource: " + resourceName );
    InputStream rsrc = classLoader.getResourceAsStream( resourceName );
    if ( rsrc == null ) {
      throw new MappingNotFoundException( "resource", resourceName );
    }
    try {
      return addInputStream( rsrc );
    }
    catch (MappingException me) {
View Full Code Here

    }
    if ( rsrc == null ) {
      rsrc = Environment.class.getClassLoader().getResourceAsStream( resourceName );
    }
    if ( rsrc == null ) {
      throw new MappingNotFoundException( "resource", resourceName );
    }
    try {
      return addInputStream( rsrc );
    }
    catch (MappingException me) {
View Full Code Here

    final InputSource inputSource;
    try {
      inputSource = new InputSource( new FileInputStream( xmlFile ) );
    }
    catch ( FileNotFoundException e ) {
      throw new MappingNotFoundException( "file", xmlFile.toString() );
    }
    add( inputSource, "file", name );
    return this;
  }
View Full Code Here

    final InputSource inputSource;
    try {
      inputSource = new InputSource( new FileInputStream( xmlFile ) );
    }
    catch ( FileNotFoundException e ) {
      throw new MappingNotFoundException( "file", xmlFile.toString() );
    }

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

   */
  public Configuration addResource(String resourceName, ClassLoader classLoader) throws MappingException {
    LOG.readingMappingsFromResource( resourceName );
    InputStream resourceInputStream = classLoader.getResourceAsStream( resourceName );
    if ( resourceInputStream == null ) {
      throw new MappingNotFoundException( "resource", resourceName );
    }
    add( resourceInputStream, "resource", resourceName );
    return this;
  }
View Full Code Here

    }
    if ( resourceInputStream == null ) {
      resourceInputStream = Environment.class.getClassLoader().getResourceAsStream( resourceName );
    }
    if ( resourceInputStream == null ) {
      throw new MappingNotFoundException( "resource", resourceName );
    }
    add( resourceInputStream, "resource", resourceName );
    return this;
  }
View Full Code Here

TOP

Related Classes of org.hibernate.MappingNotFoundException

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.