1 2 12 package com.versant.core.jdbc.sql.diff; 13 14 import com.versant.core.jdbc.metadata.JdbcConstraint; 15 16 19 public class ConstraintDiff { 20 boolean extraConstraint = false; 21 boolean missingConstraint = false; 22 boolean extraCol = false; 23 boolean missingCol = false; 24 boolean recreate = false; 25 private JdbcConstraint ourConstraint; 26 private JdbcConstraint dbConstraint; 27 private boolean drop = true; 28 29 public ConstraintDiff(JdbcConstraint ourConstraint, JdbcConstraint dbConstraint) { 30 this.ourConstraint = ourConstraint; 31 this.dbConstraint = dbConstraint; 32 } 33 34 public boolean isExtraConstraint() { 35 return extraConstraint; 36 } 37 38 public void setExtraConstraint(boolean extraConstraint) { 39 this.extraConstraint = extraConstraint; 40 } 41 42 public boolean isMissingConstraint() { 43 return missingConstraint; 44 } 45 46 public void setMissingConstraint(boolean missingConstraint) { 47 this.missingConstraint = missingConstraint; 48 } 49 50 public boolean isExtraCol() { 51 return extraCol; 52 } 53 54 public void setExtraCol(boolean extraCol) { 55 this.extraCol = extraCol; 56 } 57 58 public boolean isMissingCol() { 59 return missingCol; 60 } 61 62 public void setMissingCol(boolean missingCol) { 63 this.missingCol = missingCol; 64 } 65 66 public JdbcConstraint getOurConstraint() { 67 return ourConstraint; 68 } 69 70 public JdbcConstraint getDbConstraint() { 71 return dbConstraint; 72 } 73 74 public boolean hasErrors() { 75 return extraConstraint || missingConstraint || extraCol || missingCol; 76 } 77 78 public boolean drop() { 79 return drop; 80 } 81 82 public void setDrop(boolean drop){ 83 this.drop = drop; 84 } 85 86 public boolean isRecreate() { 87 return recreate; 88 } 89 90 public void setRecreate(boolean recreate) { 91 this.recreate = recreate; 92 } 93 } 94 | Popular Tags |