[#5460] Convenience overloads
This commit is contained in:
parent
227c0c0777
commit
83c5769168
@ -215,6 +215,14 @@ public interface DSLContext extends Scope , AutoCloseable {
|
||||
*/
|
||||
InformationSchema informationSchema(Catalog catalog);
|
||||
|
||||
/**
|
||||
* Export a set of catalogs to the {@link InformationSchema} format.
|
||||
* <p>
|
||||
* This allows for serialising schema meta information as XML using JAXB.
|
||||
* See also {@link Constants#XSD_META} for details.
|
||||
*/
|
||||
InformationSchema informationSchema(Catalog... catalogs);
|
||||
|
||||
/**
|
||||
* Export a schema to the {@link InformationSchema} format.
|
||||
* <p>
|
||||
@ -223,6 +231,14 @@ public interface DSLContext extends Scope , AutoCloseable {
|
||||
*/
|
||||
InformationSchema informationSchema(Schema schema);
|
||||
|
||||
/**
|
||||
* Export a set of schemas to the {@link InformationSchema} format.
|
||||
* <p>
|
||||
* This allows for serialising schema meta information as XML using JAXB.
|
||||
* See also {@link Constants#XSD_META} for details.
|
||||
*/
|
||||
InformationSchema informationSchema(Schema... schemas);
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// XXX APIs for creating scope for transactions, mocking, batching, etc.
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
@ -383,11 +383,26 @@ public class DefaultDSLContext extends AbstractScope implements DSLContext, Seri
|
||||
return informationSchema0(catalog.getSchemas());
|
||||
}
|
||||
|
||||
@Override
|
||||
public InformationSchema informationSchema(Catalog... catalogs) {
|
||||
List<Schema> schemas = new ArrayList<Schema>();
|
||||
|
||||
for (Catalog catalog : catalogs)
|
||||
schemas.addAll(catalog.getSchemas());
|
||||
|
||||
return informationSchema0(schemas);
|
||||
}
|
||||
|
||||
@Override
|
||||
public InformationSchema informationSchema(Schema schema) {
|
||||
return informationSchema0(Arrays.asList(schema));
|
||||
}
|
||||
|
||||
@Override
|
||||
public InformationSchema informationSchema(Schema... schemas) {
|
||||
return informationSchema0(Arrays.asList(schemas));
|
||||
}
|
||||
|
||||
private final InformationSchema informationSchema0(List<Schema> schemas) {
|
||||
return InformationSchemaExport.export(configuration(), schemas);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user