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.JdbcConstraint;
14:
15: /**
16: * @keep-all
17: */
18: public class ConstraintDiff {
19: boolean extraConstraint = false;
20: boolean missingConstraint = false;
21: boolean extraCol = false;
22: boolean missingCol = false;
23: boolean recreate = false;
24: private JdbcConstraint ourConstraint;
25: private JdbcConstraint dbConstraint;
26: private boolean drop = true;
27:
28: public ConstraintDiff(JdbcConstraint ourConstraint,
29: JdbcConstraint dbConstraint) {
30: this .ourConstraint = ourConstraint;
31: this .dbConstraint = dbConstraint;
32: }
33:
34: public boolean isExtraConstraint() {
35: return extraConstraint;
36: }
37:
38: public void setExtraConstraint(boolean extraConstraint) {
39: this .extraConstraint = extraConstraint;
40: }
41:
42: public boolean isMissingConstraint() {
43: return missingConstraint;
44: }
45:
46: public void setMissingConstraint(boolean missingConstraint) {
47: this .missingConstraint = missingConstraint;
48: }
49:
50: public boolean isExtraCol() {
51: return extraCol;
52: }
53:
54: public void setExtraCol(boolean extraCol) {
55: this .extraCol = extraCol;
56: }
57:
58: public boolean isMissingCol() {
59: return missingCol;
60: }
61:
62: public void setMissingCol(boolean missingCol) {
63: this .missingCol = missingCol;
64: }
65:
66: public JdbcConstraint getOurConstraint() {
67: return ourConstraint;
68: }
69:
70: public JdbcConstraint getDbConstraint() {
71: return dbConstraint;
72: }
73:
74: public boolean hasErrors() {
75: return extraConstraint || missingConstraint || extraCol
76: || missingCol;
77: }
78:
79: public boolean drop() {
80: return drop;
81: }
82:
83: public void setDrop(boolean drop) {
84: this .drop = drop;
85: }
86:
87: public boolean isRecreate() {
88: return recreate;
89: }
90:
91: public void setRecreate(boolean recreate) {
92: this.recreate = recreate;
93: }
94: }
|