KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > versant > core > jdbc > sql > diff > PKDiff


1
2 /*
3  * Copyright (c) 1998 - 2005 Versant Corporation
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  * Versant Corporation - initial API and implementation
11  */

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 JavaDoc;
18
19 /**
20  * @keep-all
21  */

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 JavaDoc dropConstraintsRefs = new ArrayList JavaDoc();
29     private ArrayList JavaDoc addConstraintsRefs = new ArrayList JavaDoc();
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 JavaDoc getDropConstraintsRefs() {
69         return dropConstraintsRefs;
70     }
71
72     public void setDropConstraintsRefs(JdbcConstraint constraint) {
73         this.dropConstraintsRefs.add(constraint);
74     }
75
76     public ArrayList JavaDoc 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