1
2
3
4
5
6
7 package org.asyrinx.joey.gen.model.rdb;
8
9 import org.apache.commons.lang.builder.EqualsBuilder;
10 import org.asyrinx.joey.gen.model.ElementSet;
11
12 /***
13 * @author akima
14 */
15 public class Index extends ElementSet {
16
17 /***
18 *
19 */
20 public Index() {
21 super((String) null);
22 }
23
24 /***
25 *
26 */
27 public Index(Table parent) {
28 super(parent, null);
29 }
30
31 /***
32 *
33 */
34 public Index(Table parent, String name) {
35 super(parent, name);
36 }
37
38
39
40
41
42
43 public boolean isEntity() {
44 return true;
45 }
46
47
48
49
50
51
52 public void add(IndexEntry entry) {
53 super.add(entry);
54 }
55
56
57
58
59
60
61 public boolean contains(IndexEntry entry) {
62 return super.contains(entry);
63 }
64
65
66
67
68
69
70 public IndexEntry getEntry(int index) {
71 return (IndexEntry) super.getElement(index);
72 }
73
74
75
76
77
78
79 public IndexEntry getEntry(String name) {
80 return (IndexEntry) super.getElement(name);
81 }
82
83
84
85
86
87
88 public IndexEntry removeEntry(String name) {
89 return (IndexEntry) super.removeElement(name);
90 }
91
92
93
94
95
96
97 public Table getParent() {
98 return (Table) super.getParentElement();
99 }
100
101 private boolean unique = false;
102
103 /***
104 * @return Returns the unique.
105 */
106 public boolean isUnique() {
107 return unique;
108 }
109
110 /***
111 * @param unique
112 * The unique to set.
113 */
114 public void setUnique(boolean unique) {
115 this.unique = unique;
116 }
117
118
119
120
121
122
123 public boolean equals(Object obj) {
124 if (!super.equals(obj))
125 return false;
126 if (!(obj instanceof Index))
127 return false;
128 final Index other = (Index) obj;
129 return new EqualsBuilder()
130 .append(this.isUnique(), other.isUnique())
131 .isEquals();
132 }
133
134
135
136
137
138
139 public boolean careChildOrder() {
140 return true;
141 }
142 }