use of org.jooq.util.SchemaDefinition in project jOOQ by jOOQ.
the class SQLiteDatabase method getSchemata0.
@Override
protected List<SchemaDefinition> getSchemata0() throws SQLException {
List<SchemaDefinition> result = new ArrayList<SchemaDefinition>();
result.add(new SchemaDefinition(this, "", ""));
return result;
}
use of org.jooq.util.SchemaDefinition in project jOOQ by jOOQ.
the class XMLDatabase method getPackages0.
@Override
protected List<PackageDefinition> getPackages0() {
List<PackageDefinition> result = new ArrayList<PackageDefinition>();
Set<String> packages = new HashSet<String>();
for (Routine routine : info().getRoutines()) {
String schemaName = defaultIfBlank(routine.getSpecificSchema(), routine.getRoutineSchema());
if (getInputSchemata().contains(schemaName)) {
SchemaDefinition schema = getSchema(schemaName);
String packageName = defaultIfBlank(routine.getSpecificPackage(), routine.getRoutinePackage());
if (!isBlank(packageName) && packages.add(packageName)) {
result.add(new XMLPackageDefinition(schema, info(), packageName));
}
}
}
return result;
}
use of org.jooq.util.SchemaDefinition in project jOOQ by jOOQ.
the class XMLDatabase method getRoutines0.
@Override
protected List<RoutineDefinition> getRoutines0() {
List<RoutineDefinition> result = new ArrayList<RoutineDefinition>();
for (Routine routine : info().getRoutines()) {
if (isBlank(routine.getSpecificPackage()) && isBlank(routine.getRoutinePackage())) {
String schemaName = defaultIfBlank(routine.getSpecificSchema(), routine.getRoutineSchema());
if (getInputSchemata().contains(schemaName)) {
SchemaDefinition schema = getSchema(schemaName);
result.add(new XMLRoutineDefinition(schema, null, info(), routine));
}
}
}
return result;
}
use of org.jooq.util.SchemaDefinition in project jOOQ by jOOQ.
the class XMLDatabase method getTables0.
@Override
protected List<TableDefinition> getTables0() {
List<TableDefinition> result = new ArrayList<TableDefinition>();
for (Table table : info().getTables()) {
if (getInputSchemata().contains(table.getTableSchema())) {
SchemaDefinition schema = getSchema(table.getTableSchema());
result.add(new XMLTableDefinition(schema, info(), table));
}
}
return result;
}
use of org.jooq.util.SchemaDefinition in project jOOQ by jOOQ.
the class XMLDatabase method loadUniqueKeys.
@Override
protected void loadUniqueKeys(DefaultRelations relations) {
for (KeyColumnUsage usage : keyColumnUsage(UNIQUE)) {
SchemaDefinition schema = getSchema(usage.getConstraintSchema());
String key = usage.getConstraintName();
String tableName = usage.getTableName();
String columnName = usage.getColumnName();
TableDefinition table = getTable(schema, tableName);
if (table != null) {
relations.addPrimaryKey(key, table.getColumn(columnName));
}
}
}
Aggregations