01: /*
02: * Copyright (c) 1998 - 2005 Versant Corporation
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * Versant Corporation - initial API and implementation
10: */
11: package com.versant.core.jdbc.sql.diff;
12:
13: import com.versant.core.jdbc.metadata.JdbcTable;
14:
15: import java.util.ArrayList;
16:
17: /**
18: * @keep-all
19: */
20: public class TableDiff {
21: boolean missingTable = false;
22: private JdbcTable ourTable;
23: private JdbcTable dbTable;
24: private boolean hasRealErrors = true;
25:
26: ArrayList colDiffs = new ArrayList();
27: ArrayList pkDiffs = new ArrayList();
28: ArrayList indexDiffs = new ArrayList();
29: ArrayList constraintDiffs = new ArrayList();
30:
31: public TableDiff(JdbcTable ourTable, JdbcTable dbTable) {
32: this .ourTable = ourTable;
33: this .dbTable = dbTable;
34: }
35:
36: public JdbcTable getOurTable() {
37: return ourTable;
38: }
39:
40: public JdbcTable getDbTable() {
41: return dbTable;
42: }
43:
44: public boolean isMissingTable() {
45: return missingTable;
46: }
47:
48: public void setMissingTable(boolean missingTable) {
49: this .missingTable = missingTable;
50: }
51:
52: public ArrayList getColDiffs() {
53: return colDiffs;
54: }
55:
56: public ArrayList getPkDiffs() {
57: return pkDiffs;
58: }
59:
60: public ArrayList getIndexDiffs() {
61: return indexDiffs;
62: }
63:
64: public ArrayList getConstraintDiffs() {
65: return constraintDiffs;
66: }
67:
68: public boolean hasErrors() {
69: if (missingTable || !colDiffs.isEmpty() || !pkDiffs.isEmpty()
70: || !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: }
|