Public Member Functions | |
SchedulerDatabaseSchema (DatabaseSchema schema) | |
void | addTable (SchedulerDatabaseTable table) |
void | removeTable (SchedulerDatabaseTable table) |
void | mergeSchema (SchedulerDatabaseSchema databaseSchema) |
ArrayList | getTables () |
SchedulerDatabaseTable | getTable (String tableName) |
boolean | hasTable (String tableName) |
TransactionExclusiveLock | getLock () |
boolean | equals (Object other) |
String | getInformation (boolean longFormat) |
SchedulerDatabaseSchema
describes all the tables and columns of a database and its associated cache entries.
Definition at line 40 of file SchedulerDatabaseSchema.java.
|
Creates a new
Definition at line 53 of file SchedulerDatabaseSchema.java. References org.objectweb.cjdbc.common.sql.schema.DatabaseSchema.getTables(). 00054 { 00055 if (schema == null) 00056 { 00057 tables = new ArrayList(); 00058 return; 00059 } 00060 00061 // Clone the tables 00062 ArrayList origTables = schema.getTables(); 00063 int size = origTables.size(); 00064 tables = new ArrayList(size); 00065 for (int i = 0; i < size; i++) 00066 tables.add(new SchedulerDatabaseTable((DatabaseTable) origTables.get(i))); 00067 }
|
|
Adds a
Definition at line 75 of file SchedulerDatabaseSchema.java. Referenced by org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseSchema.mergeSchema(). 00076 { 00077 tables.add(table); 00078 }
|
|
Two
Definition at line 185 of file SchedulerDatabaseSchema.java. References org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseSchema.getTables(). 00186 { 00187 if (!(other instanceof SchedulerDatabaseSchema)) 00188 return false; 00189 00190 if (tables == null) 00191 return ((SchedulerDatabaseSchema) other).getTables() == null; 00192 else 00193 return tables.equals(((SchedulerDatabaseSchema) other).getTables()); 00194 }
|
|
Returns information about the database schema.
Definition at line 203 of file SchedulerDatabaseSchema.java. References org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseTable.getInformation(). 00204 { 00205 StringBuffer result = new StringBuffer(); 00206 SchedulerDatabaseTable t; 00207 int size = tables.size(); 00208 for (int i = 0; i < size; i++) 00209 { 00210 t = (SchedulerDatabaseTable) tables.get(i); 00211 result.append(t.getInformation(longFormat)); 00212 result.append(System.getProperty("line.separator")); 00213 } 00214 return result.toString(); 00215 }
|
|
Returns the lock for this table.
Definition at line 173 of file SchedulerDatabaseSchema.java. 00174 {
00175 return lock;
00176 }
|
|
Returns the
Definition at line 135 of file SchedulerDatabaseSchema.java. References org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseTable.getName(). Referenced by org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseSchema.mergeSchema(). 00136 { 00137 SchedulerDatabaseTable t; 00138 int size = tables.size(); 00139 for (int i = 0; i < size; i++) 00140 { 00141 t = (SchedulerDatabaseTable) tables.get(i); 00142 if (tableName.equalsIgnoreCase(t.getName())) 00143 return t; 00144 } 00145 return null; 00146 }
|
|
Returns an
Definition at line 123 of file SchedulerDatabaseSchema.java. Referenced by org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseSchema.equals(), and org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseSchema.mergeSchema(). 00124 {
00125 return tables;
00126 }
|
|
Returns
Definition at line 155 of file SchedulerDatabaseSchema.java. References org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseTable.getName(). 00156 { 00157 int size = tables.size(); 00158 for (int i = 0; i < size; i++) 00159 { 00160 SchedulerDatabaseTable t = (SchedulerDatabaseTable) tables.get(i); 00161 if (tableName.equals(t.getName())) 00162 return true; 00163 } 00164 return false; 00165 }
|
|
Merge the given schema with the current one. All missing tables are added if no conflict is detected. An exception is thrown if the given schema definition conflicts with the current one.
Definition at line 98 of file SchedulerDatabaseSchema.java. References org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseSchema.addTable(), org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseTable.getName(), org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseSchema.getTable(), and org.objectweb.cjdbc.controller.scheduler.schema.SchedulerDatabaseSchema.getTables(). 00099 { 00100 if (databaseSchema == null) 00101 return; 00102 00103 ArrayList otherTables = databaseSchema.getTables(); 00104 if (otherTables == null) 00105 return; 00106 00107 int size = otherTables.size(); 00108 for (int i = 0; i < size; i++) 00109 { 00110 SchedulerDatabaseTable t = (SchedulerDatabaseTable) otherTables.get(i); 00111 SchedulerDatabaseTable original = getTable(t.getName()); 00112 if (original == null) 00113 addTable(t); 00114 } 00115 }
|
|
Removes a
Definition at line 86 of file SchedulerDatabaseSchema.java. 00087 { 00088 tables.remove(table); 00089 }
|