Package org.databene.mad4db.cmd

Examples of org.databene.mad4db.cmd.NotNullConstraintCreation


    else if (dbObject instanceof DBPrimaryKeyConstraint)
      return (Creation<E>) new PrimaryKeyCreation((DBPrimaryKeyConstraint) dbObject);
    else if (dbObject instanceof DBUniqueConstraint)
      return (Creation<E>) new UniqueConstraintCreation((DBUniqueConstraint) dbObject);
    else if (dbObject instanceof DBNotNullConstraint)
      return (Creation<E>) new NotNullConstraintCreation((DBNotNullConstraint) dbObject);
    else if (dbObject instanceof DBForeignKeyConstraint)
      return (Creation<E>) new ForeignKeyConstraintCreation((DBForeignKeyConstraint) dbObject);
    else if (dbObject instanceof DBCheckConstraint)
      return (Creation<E>) new CheckConstraintCreation((DBCheckConstraint) dbObject);
    else if (dbObject instanceof DBIndex)
View Full Code Here


    if (!NullSafeComparator.equals(col1.getDefaultValue(), col2.getDefaultValue()))
      columnChange.addSubChange(new DefaultValueChange(col1, col2.getDefaultValue()));
   
    // check column nullability
    if (col1.isNullable() && !col2.isNullable())
      columnChange.addSubChange(new NotNullConstraintCreation(col2.getNotNullConstraint()));
    if (!col1.isNullable() && col2.isNullable())
      columnChange.addSubChange(new ConstraintDeletion<DBNotNullConstraint>(col1.getNotNullConstraint()));

    // if there were changes, add them to the parent tableChange
    if (columnChange.getSubChanges().size() > 0)
View Full Code Here

    DBColumn newColumn = new DBColumn("C1", newTable, DBDataType.getInstance("INTEGER"));
    DBColumn newColumn2 = new DBColumn("C2", newTable, DBDataType.getInstance("INTEGER"));
    DBNotNullConstraint constraint = new DBNotNullConstraint(newTable, "T_C1_NOT_NULL", true, "C1");
    newColumn.setNotNullConstraint(constraint);
   
    NotNullConstraintCreation constraintCreation = new NotNullConstraintCreation(constraint);
    ColumnChange columnChange = new ColumnChange(newColumn);
    columnChange.addSubChange(constraintCreation);
    TableChange tableChange = new TableChange(oldTable, newTable);
    tableChange.addSubChange(columnChange);
   
View Full Code Here

TOP

Related Classes of org.databene.mad4db.cmd.NotNullConstraintCreation

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.