KickJava   Java API By Example, From Geeks To Geeks.

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


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.JdbcTable;
15
16 import java.util.ArrayList JavaDoc;
17
18 /**
19  * @keep-all
20  */

21 public class TableDiff {
22     boolean missingTable = false;
23     private JdbcTable ourTable;
24     private JdbcTable dbTable;
25     private boolean hasRealErrors = true;
26
27     ArrayList JavaDoc colDiffs = new ArrayList JavaDoc();
28     ArrayList JavaDoc pkDiffs = new ArrayList JavaDoc();
29     ArrayList JavaDoc indexDiffs = new ArrayList JavaDoc();
30     ArrayList JavaDoc constraintDiffs = new ArrayList JavaDoc();
31
32     public TableDiff(JdbcTable ourTable, JdbcTable dbTable) {
33         this.ourTable = ourTable;
34         this.dbTable = dbTable;
35     }
36
37     public JdbcTable getOurTable() {
38         return ourTable;
39     }
40
41     public JdbcTable getDbTable() {
42         return dbTable;
43     }
44
45     public boolean isMissingTable() {
46         return missingTable;
47     }
48
49     public void setMissingTable(boolean missingTable) {
50         this.missingTable = missingTable;
51     }
52
53     public ArrayList JavaDoc getColDiffs() {
54         return colDiffs;
55     }
56
57     public ArrayList JavaDoc getPkDiffs() {
58         return pkDiffs;
59     }
60
61     public ArrayList JavaDoc getIndexDiffs() {
62         return indexDiffs;
63     }
64
65     public ArrayList JavaDoc getConstraintDiffs() {
66         return constraintDiffs;
67     }
68
69     public boolean hasErrors() {
70         if (missingTable || !colDiffs.isEmpty() || !pkDiffs.isEmpty() || !indexDiffs.isEmpty() || !constraintDiffs.isEmpty()) {
71             return true;
72         } else {
73             return false;
74         }
75     }
76
77     public boolean hasRealErrors() {
78         return hasRealErrors;
79     }
80
81     public void setHasRealErrors(boolean hasRealErrors) {
82         this.hasRealErrors = hasRealErrors;
83     }
84 }
85
86
Popular Tags