Search in sources :

Example 1 with PackageDefinition

use of org.jooq.util.PackageDefinition 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;
}
Also used : SchemaDefinition(org.jooq.util.SchemaDefinition) PackageDefinition(org.jooq.util.PackageDefinition) ArrayList(java.util.ArrayList) Routine(org.jooq.util.xml.jaxb.Routine) HashSet(java.util.HashSet)

Aggregations

ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 PackageDefinition (org.jooq.util.PackageDefinition)1 SchemaDefinition (org.jooq.util.SchemaDefinition)1 Routine (org.jooq.util.xml.jaxb.Routine)1