projects
/
cfb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add code to load bug categories and patterns from the FindBugs messages.xml file.
[cfb.git]
/
prod
/
net
/
jaekl
/
cfb
/
db
/
Schema.java
diff --git
a/prod/net/jaekl/cfb/db/Schema.java
b/prod/net/jaekl/cfb/db/Schema.java
index b6dc6012fc6d720ded5ecae5383c7943e4558afe..f802b58ca3cf71f89f7b5ef6c8b0f57c95382c66 100644
(file)
--- a/
prod/net/jaekl/cfb/db/Schema.java
+++ b/
prod/net/jaekl/cfb/db/Schema.java
@@
-16,11
+16,13
@@
public class Schema {
String m_name;
DbDriver m_driver;
ArrayList<Table> m_tables;
String m_name;
DbDriver m_driver;
ArrayList<Table> m_tables;
+ ArrayList<Sequence> m_sequences;
public Schema(String name, DbDriver driver) {
m_name = name;
m_driver = driver;
m_tables = new ArrayList<Table>();
public Schema(String name, DbDriver driver) {
m_name = name;
m_driver = driver;
m_tables = new ArrayList<Table>();
+ m_sequences = new ArrayList<Sequence>();
}
public boolean ensureDbInitialized(Connection con) throws SQLException {
}
public boolean ensureDbInitialized(Connection con) throws SQLException {
@@
-34,6
+36,10
@@
public class Schema {
return false;
}
return false;
}
+ if (!createAllSequences(con)) {
+ return false;
+ }
+
return true;
}
return true;
}
@@
-73,6
+79,15
@@
public class Schema {
return true;
}
return true;
}
+ boolean createAllSequences(Connection con) throws SQLException {
+ for (Sequence seq : m_sequences) {
+ if (!m_driver.createSequence(con, seq)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
void addTable(Table table) {
m_tables.add(table);
}
void addTable(Table table) {
m_tables.add(table);
}
@@
-88,5
+103,9
@@
public class Schema {
for (Object[][] table : tables) {
addTable(Table.construct(table));
}
for (Object[][] table : tables) {
addTable(Table.construct(table));
}
- }
+ }
+
+ void addSequence(Sequence seq) {
+ m_sequences.add(seq);
+ }
}
}