Package net.sourceforge.squirrel_sql.plugins.mssql.sql.constraint

Examples of net.sourceforge.squirrel_sql.plugins.mssql.sql.constraint.DefaultConstraint


        // String statusForReplication = rs.getString(6);
        String constraintKeys = rs.getString(7);

        if (constraintType.startsWith("DEFAULT"))
        {
          DefaultConstraint def = new DefaultConstraint();
          String col = constraintType.substring(18).trim(); // chop off "DEFAULT on column ";

          def.setConstraintName(constraintName);
          def.addConstraintColumn(col);
          def.setDefaultExpression(constraintKeys);

          constraints.addConstraint(def);
        }
        else if (constraintType.startsWith("CHECK"))
        {
View Full Code Here


          List<DefaultConstraint> defs = constraints.getDefaultsForColumn(colName);
          /* there can be only one default in truth, but the model allows more than one. */

          if (defs != null && defs.size() == 1)
          {
            DefaultConstraint def = defs.get(0);
            buf.append("CONSTRAINT [");
            buf.append(def.getConstraintName());
            buf.append("] DEFAULT ");
            buf.append(def.getDefaultExpression());
            buf.append(" ");
          }
        }

        buf.append(",\n");
View Full Code Here

        assertEquals(1, constraints.length);
    }

    @Test
    public final void testGetDefaultsForColumn() {
      DefaultConstraint constraint = new DefaultConstraint();
      constraint.addConstraintColumn(TEST_COLUMN);
      constraintsUnderTest.addConstraint(constraint);
      List<DefaultConstraint> list = constraintsUnderTest.getDefaultsForColumn(TEST_COLUMN);
      assertEquals(1, list.size());
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.squirrel_sql.plugins.mssql.sql.constraint.DefaultConstraint

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.