Package org.hibernate

Examples of org.hibernate.DuplicateMappingException


    }

    public void addResultSetMapping(ResultSetMappingDefinition sqlResultSetMapping) throws DuplicateMappingException {
      Object old = sqlResultSetMappings.put( sqlResultSetMapping.getName(), sqlResultSetMapping );
      if ( old != null ) {
        throw new DuplicateMappingException( "resultSet",  sqlResultSetMapping.getName() );
      }
    }
View Full Code Here


      String key = buildTableNameKey( schema, catalog, physicalName );
      TableDescription tableDescription = new TableDescription( logicalName, denormalizedSuperTable );
      TableDescription oldDescriptor = ( TableDescription ) tableNameBinding.put( key, tableDescription );
      if ( oldDescriptor != null && ! oldDescriptor.logicalName.equals( logicalName ) ) {
        //TODO possibly relax that
        throw new DuplicateMappingException(
            "Same physical table name [" + physicalName + "] references several logical table names: [" +
                oldDescriptor.logicalName + "], [" + logicalName + ']',
            "table",
            physicalName
        );
View Full Code Here

        if ( existingPhysicalName != null ) {
          boolean areSamePhysicalColumn = physicalColumn.isQuoted()
              ? existingPhysicalName.equals( physicalName )
              : existingPhysicalName.equalsIgnoreCase( physicalName );
          if ( ! areSamePhysicalColumn ) {
            throw new DuplicateMappingException(
                " Table [" + tableName + "] contains logical column name [" + logicalName
                    + "] referenced by multiple physical column names: [" + existingPhysicalName
                    + "], [" + physicalName + "]",
                "column-binding",
                tableName + "." + logicalName
View Full Code Here

      private void bindPhysicalToLogical(String logicalName, Column physicalColumn) throws DuplicateMappingException {
        final String physicalName = physicalColumn.getQuotedName();
        final String existingLogicalName = ( String ) physicalToLogical.put( physicalName, logicalName );
        if ( existingLogicalName != null && ! existingLogicalName.equals( logicalName ) ) {
          throw new DuplicateMappingException(
              " Table [" + tableName + "] contains phyical column name [" + physicalName
                  + "] represented by different logical column names: [" + existingLogicalName
                  + "], [" + logicalName + "]",
              "column-binding",
              tableName + "." + physicalName
View Full Code Here

        if ( existingPhysicalName != null ) {
          boolean areSamePhysicalColumn = physicalColumn.isQuoted()
              ? existingPhysicalName.equals( physicalName )
              : existingPhysicalName.equalsIgnoreCase( physicalName );
          if ( ! areSamePhysicalColumn ) {
            throw new DuplicateMappingException(
                " Table [" + tableName + "] contains logical column name [" + logicalName
                    + "] referenced by multiple physical column names: [" + existingPhysicalName
                    + "], [" + physicalName + "]",
                "column-binding",
                tableName + "." + logicalName
View Full Code Here

      private void bindPhysicalToLogical(String logicalName, Column physicalColumn) throws DuplicateMappingException {
        final String physicalName = physicalColumn.getQuotedName();
        final String existingLogicalName = ( String ) physicalToLogical.put( physicalName, logicalName );
        if ( existingLogicalName != null && ! existingLogicalName.equals( logicalName ) ) {
          throw new DuplicateMappingException(
              " Table [" + tableName + "] contains phyical column name [" + physicalName
                  + "] represented by different logical column names: [" + existingLogicalName
                  + "], [" + logicalName + "]",
              "column-binding",
              tableName + "." + physicalName
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

    public void addImport(String entityName, String rename) throws DuplicateMappingException {
      String existing = imports.put( rename, entityName );
      if ( existing != null ) {
                if (existing.equals(entityName)) LOG.duplicateImport(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

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.