Examples of MappingException


Examples of org.hibernate.MappingException

      ForeignKey fk = (ForeignKey) iter.next();
      if ( !done.contains( fk ) ) {
        done.add( fk );
        final String referencedEntityName = fk.getReferencedEntityName();
        if ( referencedEntityName == null ) {
          throw new MappingException(
              "An association from the table " +
              fk.getTable().getName() +
              " does not specify the referenced entity"
            );
        }
                LOG.debugf("Resolving reference to class: %s", referencedEntityName);
        PersistentClass referencedClass = classes.get( referencedEntityName );
        if ( referencedClass == null ) {
          throw new MappingException(
              "An association from the table " +
              fk.getTable().getName() +
              " refers to an unmapped class: " +
              referencedEntityName
            );
View Full Code Here

Examples of org.hibernate.MappingException

    try {
      List errors = new ArrayList();
      Document document = xmlHelper.createSAXReader( resourceName, errors, entityResolver )
          .read( new InputSource( stream ) );
      if ( errors.size() != 0 ) {
        throw new MappingException( "invalid configuration", (Throwable) errors.get( 0 ) );
      }
      doConfigure( document );
    }
    catch (DocumentException e) {
      throw new HibernateException( "Could not parse configuration: " + resourceName, e );
View Full Code Here

Examples of org.hibernate.MappingException

            LOG.debugf("Session-factory config [%s] named class [%s] for mapping", name, className);
      try {
        addAnnotatedClass( ReflectHelper.classForName( className ) );
      }
      catch ( Exception e ) {
        throw new MappingException(
            "Unable to load class [ " + className + "] declared in Hibernate configuration <mapping/> entry",
            e
        );
      }
    }
    else {
      throw new MappingException( "<mapping> element in configuration specifies no known attributes" );
    }
  }
View Full Code Here

Examples of org.hibernate.MappingException

  RootClass getRootClassMapping(String clazz) throws MappingException {
    try {
      return (RootClass) getClassMapping( clazz );
    }
    catch (ClassCastException cce) {
      throw new MappingException( "You may only specify a cache for root <class> mappings" );
    }
  }
View Full Code Here

Examples of org.hibernate.MappingException

  }

  private void applyCacheConcurrencyStrategy(CacheHolder holder) {
    RootClass rootClass = getRootClassMapping( holder.role );
    if ( rootClass == null ) {
      throw new MappingException( "Cannot cache an unknown entity: " + holder.role );
    }
    rootClass.setCacheConcurrencyStrategy( holder.usage );
    rootClass.setCacheRegionName( holder.region );
    rootClass.setLazyPropertiesCacheable( holder.cacheLazy );
  }
View Full Code Here

Examples of org.hibernate.metamodel.source.MappingException

            LOG.tracef( "found mapping document : %s", zipEntry.getName() );
            try {
              add( jarFile.getInputStream( zipEntry ), origin, true );
            }
            catch ( Exception e ) {
              throw new MappingException( "could not read mapping documents", e, origin );
            }
          }
        }
      }
      finally {
View Full Code Here

Examples of org.jdbf.engine.mapping.MappingException

                                "Connection.connectionAdded",dbMap.getName()));
        }
    }
    catch(ClassNotFoundException e){
        logger.throwing(CLASS_NAME,"createConnection()",
                            new MappingException("class.noClassDefFound",dbMap.getDbDriver())
                           );
            throw new MappingException("class.noClassDefFound",dbMap.getDbDriver());
    }
    catch(SQLException e){
        logger.throwing(CLASS_NAME,"createConnection()",
                            new MappingException("mapping.connNotFound",dbMap.getDbServer())
                           );
            throw new MappingException("mapping.connNotFound",dbMap.getDbServer());
    }   
    }
View Full Code Here

Examples of org.jooq.exception.MappingException

            }
        }

        // All reflection exceptions are intercepted
        catch (Exception e) {
            throw new MappingException("An error ocurred when mapping record to " + type, e);
        }
    }
View Full Code Here

Examples of org.megatome.frame2.introspector.MappingException

      assertTrue(e instanceof MappingsException);
      MappingsException mes = (MappingsException) e;

      List<MappingException> mec = mes.getMappingExceptions();
      assertTrue(mec.size() == 1);
      MappingException me = mec.get(0);

      assertTrue(me.getBeanName().equals(
          "org.megatome.frame2.front.Event1")); //$NON-NLS-1$
      assertTrue(me.getProperty().equals("parm3")); //$NON-NLS-1$

      assertNotNull(me.getCause());
      assertTrue(me.getCause() instanceof NumberFormatException);
    }
  }
View Full Code Here

Examples of org.modelmapper.MappingException

  public ErrorsException toException() {
    return new ErrorsException(this);
  }

  public MappingException toMappingException() {
    return new MappingException(getMessages());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.