diff --git a/modules/dbsupport/src/main/java/org/jpos/ee/DB.java b/modules/dbsupport/src/main/java/org/jpos/ee/DB.java index c134437ca1..465b023f35 100644 --- a/modules/dbsupport/src/main/java/org/jpos/ee/DB.java +++ b/modules/dbsupport/src/main/java/org/jpos/ee/DB.java @@ -247,15 +247,19 @@ public void createSchema(String outputFile, boolean create) throws HibernateExce try { // SchemaExport export = new SchemaExport(getMetadata()); SchemaExport export = new SchemaExport(); - EnumSet targetTypes = EnumSet.of(TargetType.STDOUT); + List targetTypes=new ArrayList<>(); if (outputFile != null) { - export.setOutputFile(outputFile); - export.setDelimiter(";"); - targetTypes.add(TargetType.SCRIPT); + if(outputFile.trim().equals("-")) targetTypes.add(TargetType.STDOUT); + else { + export.setOutputFile(outputFile); + export.setDelimiter(";"); + targetTypes.add(TargetType.SCRIPT); + } } if (create) targetTypes.add(TargetType.DATABASE); - export.create(targetTypes, getMetadata()); + if(targetTypes.size()>0) + export.create(EnumSet.copyOf(targetTypes), getMetadata()); } catch (IOException | ConfigurationException e) {