Package org.hibernate

Examples of org.hibernate.DuplicateMappingException


    }
  }
  public void addCollection(Collection collection) throws MappingException {
    Object old = collections.put( collection.getRole(), collection );
    if ( old!=null ) {
      throw new DuplicateMappingException( "collection role", collection.getRole() );
    }
  }
View Full Code Here


    if ( existing!=null ) {
      if ( existing.equals(className) ) {
        log.info( "duplicate import: " + className + "->" + rename );
      }
      else {
        throw new DuplicateMappingException(
            "duplicate import: " + rename +
            " refers to both " + className +
            " and " + existing +
            " (try using auto-import=\"false\")",
            "import",
View Full Code Here

  throws MappingException {
        String key = subselect==null ?
            Table.qualify(catalog, schema, name) :
            subselect;
    if ( tables.containsKey(key) ) {
      throw new DuplicateMappingException("table", name);
    }
   
    Table table = new DenormalizedTable(includedTable);
    table.setAbstract(isAbstract);
    table.setName(name);
View Full Code Here

    sqlqueries.put( name.intern(), query );
  }

  private void checkQueryExist(String name) throws MappingException {
    if ( sqlqueries.containsKey(name) || queries.containsKey(name) ) {
      throw new DuplicateMappingException("query", name);
    }
  }
View Full Code Here

  }

  public void addResultSetMapping(ResultSetMappingDefinition sqlResultSetMapping) {
    final String name = sqlResultSetMapping.getName();
    if ( resultSetMappings.containsKey(name) ) {
      throw new DuplicateMappingException("resultSet",  name);
    }
    resultSetMappings.put(name, sqlResultSetMapping);
  }
View Full Code Here

    }

    public void addClass(PersistentClass persistentClass) throws DuplicateMappingException {
      Object old = classes.put( persistentClass.getEntityName(), persistentClass );
      if ( old != null ) {
        throw new DuplicateMappingException( "class/entity", persistentClass.getEntityName() );
      }
    }
View Full Code Here

      if ( existing != null ) {
        if ( existing.equals( entityName ) ) {
          log.info( "duplicate import: {} -> {}", entityName, rename );
        }
        else {
          throw new DuplicateMappingException(
              "duplicate import: " + rename + " refers to both " + entityName +
                  " and " + existing + " (try using auto-import=\"false\")",
              "import",
              rename
          );
View Full Code Here

    }

    public void addCollection(Collection collection) throws DuplicateMappingException {
      Object old = collections.put( collection.getRole(), collection );
      if ( old != null ) {
        throw new DuplicateMappingException( "collection role", collection.getRole() );
      }
    }
View Full Code Here

      schema = getObjectNameNormalizer().normalizeIdentifierQuoting( schema );
      catalog = getObjectNameNormalizer().normalizeIdentifierQuoting( catalog );

      String key = subselect == null ? Table.qualify(catalog, schema, name) : subselect;
      if ( tables.containsKey( key ) ) {
        throw new DuplicateMappingException( "table", name );
      }

      Table table = new DenormalizedTable( includedTable );
      table.setAbstract( isAbstract );
      table.setName( name );
View Full Code Here

      namedQueries.put( name.intern(), query );
    }

    private void checkQueryName(String name) throws DuplicateMappingException {
      if ( namedQueries.containsKey( name ) || namedSqlQueries.containsKey( name ) ) {
        throw new DuplicateMappingException( "query", name );
      }
    }
View Full Code Here

TOP

Related Classes of org.hibernate.DuplicateMappingException

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.