1 2 12 package com.versant.core.jdbc.sql.diff; 13 14 import com.versant.core.jdbc.metadata.JdbcColumn; 15 import com.versant.core.jdbc.metadata.JdbcConstraint; 16 17 import java.util.ArrayList ; 18 19 22 public class PKDiff { 23 boolean extraPKCol = false; 24 boolean missingPKCol = false; 25 boolean missingPK = false; 26 private JdbcColumn ourCol; 27 private JdbcColumn dbCol; 28 private ArrayList dropConstraintsRefs = new ArrayList (); 29 private ArrayList addConstraintsRefs = new ArrayList (); 30 31 public PKDiff(JdbcColumn ourCol, JdbcColumn dbCol) { 32 this.ourCol = ourCol; 33 this.dbCol = dbCol; 34 } 35 36 public boolean isExtraPKCol() { 37 return extraPKCol; 38 } 39 40 public void setExtraPKCol(boolean extraPK) { 41 this.extraPKCol = extraPK; 42 } 43 44 public boolean isMissingPKCol() { 45 return missingPKCol; 46 } 47 48 public void setMissingPKCol(boolean missingPK) { 49 this.missingPKCol = missingPK; 50 } 51 52 public boolean isMissingPK() { 53 return missingPK; 54 } 55 56 public void setMissingPK(boolean missingPK) { 57 this.missingPK = missingPK; 58 } 59 60 public JdbcColumn getOurCol() { 61 return ourCol; 62 } 63 64 public JdbcColumn getDbCol() { 65 return dbCol; 66 } 67 68 public ArrayList getDropConstraintsRefs() { 69 return dropConstraintsRefs; 70 } 71 72 public void setDropConstraintsRefs(JdbcConstraint constraint) { 73 this.dropConstraintsRefs.add(constraint); 74 } 75 76 public ArrayList getAddConstraintsRefs() { 77 return addConstraintsRefs; 78 } 79 80 public void setAddConstraintsRefs(JdbcConstraint constraint) { 81 this.addConstraintsRefs.add(constraint); 82 } 83 84 public boolean hasErrors() { 85 if (missingPK || extraPKCol || missingPKCol ) { 86 return true; 87 } else { 88 return false; 89 } 90 } 91 92 } 93 94 | Popular Tags |