List<Schema> schemata = d.getSchemata();
// For convenience and backwards-compatibility, the schema configuration can be set also directly
// in the <database/> element
if (schemata.isEmpty()) {
Schema schema = new Schema();
schema.setInputSchema(trim(d.getInputSchema()));
schema.setOutputSchema(trim(d.getOutputSchema()));
schema.setOutputSchemaToDefault(d.isOutputSchemaToDefault());
schemata.add(schema);
}
else {
if (!StringUtils.isBlank(d.getInputSchema())) {
log.warn("WARNING: Cannot combine configuration properties /configuration/generator/database/inputSchema and /configuration/generator/database/schemata");
}
if (!StringUtils.isBlank(d.getOutputSchema())) {
log.warn("WARNING: Cannot combine configuration properties /configuration/generator/database/outputSchema and /configuration/generator/database/schemata");
}
}
for (Schema schema : schemata) {
if (StringUtils.isBlank(schema.getInputSchema())) {
if (!StringUtils.isBlank(j.getSchema())) {
log.warn("WARNING: The configuration property jdbc.Schema is deprecated and will be removed in the future. Use /configuration/generator/database/inputSchema instead");
}
schema.setInputSchema(trim(j.getSchema()));
}
// [#3018] Prior to <outputSchemaToDefault/>, empty <outputSchema/> elements meant that
// the outputSchema should be the default schema. This is a bit too clever, and doesn't
// work when Maven parses the XML configurations.
if ("".equals(schema.getOutputSchema())) {
log.warn("WARNING: Empty <outputSchema/> should no longer be used to model default outputSchemas. Use <outputSchemaToDefault>true</outputSchemaToDefault>, instead. See also: https://github.com/jOOQ/jOOQ/issues/3018");
}
// [#3018] If users want the output schema to be "" then, ignore the actual <outputSchema/> configuration
if (TRUE.equals(schema.isOutputSchemaToDefault())) {
schema.setOutputSchema("");
}
else if (schema.getOutputSchema() == null) {
schema.setOutputSchema(trim(schema.getInputSchema()));
}
/* [pro] xx
xx xxxxxxx xxxxxx xxxxxxxx xxxx xxxxx xxxxxxxxxxxxxxxx xxxxxx xxxxxx
xx xxxxxxxxx xxxxxxxxxx xxxxxxxxxxxxxxx x