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

Examples of net.sourceforge.squirrel_sql.plugins.mssql.sql.constraint.TableConstraints.addConstraint()


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

          constraints.addConstraint(def);
        }
        else if (constraintType.startsWith("CHECK"))
        {
          CheckConstraint check = new CheckConstraint();
          String col = constraintType.substring(16).trim(); // chop off "CHECK on column ";
View Full Code Here


          check.setConstraintName(constraintName);
          check.addConstraintColumn(col);
          check.setCheckExpression(constraintKeys);

          constraints.addConstraint(check);
        }
        else if (constraintType.startsWith("FOREIGN KEY"))
        {
          /* NOTE: there are two rows.
           * NOTE: MssqlConstraint holds the columns in the table participating in the key.
View Full Code Here

          String primaryColumns[] =
            tableAndColumns[1].substring(1, tableAndColumns[1].length() - 2).split(",");
          for (int i = 0; i < primaryColumns.length; i++)
            fk.addPrimaryColumn(primaryColumns[i]);

          constraints.addConstraint(fk);
        }
        else if (constraintType.startsWith("PRIMARY KEY"))
        {
          PrimaryKeyConstraint pk = new PrimaryKeyConstraint();
View Full Code Here

          String cols[] = constraintKeys.split(", ");
          for (int i = 0; i < cols.length; i++)
            pk.addConstraintColumn(cols[i]);

          constraints.addConstraint(pk);
        }
      }

    }
    catch (java.sql.SQLException ex)
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.