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.JdbcIndex;
14: import com.versant.core.jdbc.metadata.JdbcConstraint;
15:
16: import java.util.ArrayList;
17:
18: /**
19: * @keep-all
20: */
21: public class IndexDiff {
22: boolean extraIndex = false;
23: boolean missingIndex = false;
24: boolean extraCol = false;
25: boolean missingCol = false;
26: boolean uniqueness = false;
27: private JdbcIndex ourIndex;
28: private JdbcIndex dbIndex;
29:
30: public IndexDiff(JdbcIndex ourIndex, JdbcIndex dbIndex) {
31: this .ourIndex = ourIndex;
32: this .dbIndex = dbIndex;
33: }
34:
35: public boolean isUniqueness() {
36: return uniqueness;
37: }
38:
39: public void setUniqueness(boolean uniqueness) {
40: this .uniqueness = uniqueness;
41: }
42:
43: public void setExtraIndex(boolean extraIndex) {
44: this .extraIndex = extraIndex;
45: }
46:
47: public void setMissingIndex(boolean missingIndex) {
48: this .missingIndex = missingIndex;
49: }
50:
51: public boolean isExtraIndex() {
52: return extraIndex;
53: }
54:
55: public boolean isMissingIndex() {
56: return missingIndex;
57: }
58:
59: public boolean isExtraCol() {
60: return extraCol;
61: }
62:
63: public void setExtraCol(boolean extraCol) {
64: this .extraCol = extraCol;
65: }
66:
67: public boolean isMissingCol() {
68: return missingCol;
69: }
70:
71: public void setMissingCol(boolean missingCol) {
72: this .missingCol = missingCol;
73: }
74:
75: public JdbcIndex getOurIndex() {
76: return ourIndex;
77: }
78:
79: public JdbcIndex getDbIndex() {
80: return dbIndex;
81: }
82:
83: public boolean hasErrors() {
84: return extraIndex || missingIndex || extraCol || missingCol
85: || uniqueness;
86: }
87: }
|