Package org.hibernate.tool.hbmlint

Examples of org.hibernate.tool.hbmlint.Issue


    // TODO: move this check into something that could check per class or collection instead.
    while ( iter.hasNext() ) {
      PersistentIdentifierGenerator generator = (PersistentIdentifierGenerator) iter.next();
      Object key = generator.generatorKey();
      if ( !isSequence(key, sequences) && !isTable( key ) ) {
        collector.reportIssue( new Issue( "MISSING_ID_GENERATOR", Issue.HIGH_PRIORITY, "Missing sequence or table: " + key));
      }
    }

   
  }
View Full Code Here


      setSchemaSelection( table );

      List list = reader.readDatabaseSchema( dbc, null, null );

      if ( list.isEmpty() ) {
        pc.reportIssue( new Issue( "SCHEMA_TABLE_MISSING",
            Issue.HIGH_PRIORITY, "Missing table "
                + Table.qualify( table.getCatalog(), table
                    .getSchema(), table.getName() ) ) );
        return;
      }
      else if ( list.size() > 1 ) {
        pc.reportIssue( new Issue( "SCHEMA_TABLE_MISSING",
            Issue.NORMAL_PRIORITY, "Found "
                + list.size()
                + " tables for "
                + Table.qualify( table.getCatalog(), table
                    .getSchema(), table.getName() ) ) );
View Full Code Here

    Column dbColumn = currentDbTable
        .getColumn( new Column( col.getName() ) );

    if ( dbColumn == null ) {
      pc.reportIssue( new Issue( "SCHEMA_COLUMN_MISSING",
          Issue.HIGH_PRIORITY, table(table) + " is missing column: " + col.getName() ) );
    }
    else {
      //TODO: this needs to be able to know if a type is truly compatible or not. Right now it requires an exact match.
      //String sqlType = col.getSqlType( dialect, mapping );
      int dbTypeCode = dbColumn.getSqlTypeCode().intValue();
      int modelTypeCode = col
                .getSqlTypeCode( mapping );
      // TODO: sqltype name string
      if ( !(dbTypeCode == modelTypeCode ) ) {
        pc.reportIssue( new Issue( "SCHEMA_COLUMN_TYPE_MISMATCH",
            Issue.NORMAL_PRIORITY, table(table) + " has a wrong column type for "
                + col.getName() + ", expected: "
                + JDBCToHibernateTypeHelper.getJDBCTypeName(modelTypeCode) + " but was " + JDBCToHibernateTypeHelper.getJDBCTypeName(dbTypeCode) + " in db") );
      }
    }
View Full Code Here

TOP

Related Classes of org.hibernate.tool.hbmlint.Issue

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.