Skip to content

Commit 85c7a6c

Browse files
committed
0.4.2
1 parent bb4a1ec commit 85c7a6c

File tree

5 files changed

+19
-2
lines changed

5 files changed

+19
-2
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.4.2] - 2023-11-24
11+
1012
## [0.4.1] - 2023-09-24
1113

1214
### Added
1315

16+
- queryFile handling in query-catalog.xml configuration file
17+
18+
### Fixed
19+
20+
- main class in pom
21+
22+
### Added
23+
1424
- Code of conduct badge and file
1525
- [Sample jdk compatibility check workflow on branch develop](.github/workflows/build_maven_compatibility.yml)
1626

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<artifactId>query-export-tool</artifactId>
1414

15-
<version>0.4.1</version>
15+
<version>0.4.2</version>
1616
<packaging>jar</packaging>
1717

1818
<name>query-export-tool</name>
@@ -144,7 +144,7 @@
144144
<archive>
145145
<manifest>
146146
<addClasspath>true</addClasspath>
147-
<mainClass>org.fugerit.java.tool.Launcher</mainClass>
147+
<mainClass>org.fugerit.java.query.export.tool.QueryExportToolMain</mainClass>
148148
</manifest>
149149
</archive>
150150
</configuration>

src/main/java/org/fugerit/java/query/export/catalog/QueryConfig.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ public class QueryConfig extends BasicIdConfigType {
1616

1717
@Getter @Setter private String sql;
1818

19+
@Getter @Setter private String queryFile;
20+
1921
@Getter @Setter private String outputFile;
2022

2123
@Getter @Setter private String outputFormat;

src/main/java/org/fugerit/java/query/export/catalog/QueryConfigCatalog.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import org.fugerit.java.core.cfg.xml.CustomListCatalogConfig;
1212
import org.fugerit.java.core.cfg.xml.GenericListCatalogConfig;
1313
import org.fugerit.java.core.function.SafeFunction;
14+
import org.fugerit.java.core.io.FileIO;
1415
import org.fugerit.java.core.io.helper.HelperIOException;
1516
import org.fugerit.java.core.io.helper.StreamHelper;
1617
import org.fugerit.java.core.lang.helpers.BooleanUtils;
@@ -64,6 +65,9 @@ public static void handle( Connection conn, QueryConfig queryConfig ) throws IOE
6465
File file = new File( outputFile );
6566
String format = queryConfig.getOutputFormat();
6667
String query = queryConfig.getSql();
68+
if ( StringUtils.isNotEmpty( queryConfig.getQueryFile() ) ) {
69+
query = FileIO.readString( queryConfig.getQueryFile() );
70+
}
6771
Properties params = new Properties();
6872
if ( StringUtils.isNotEmpty( queryConfig.getXlsResize() ) ) {
6973
params.setProperty( QueryExportFacade.ARG_XLS_RESIZE , queryConfig.getXlsResize() );

src/test/resources/sample/query-catalog-sample.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<query id="Q003" sql="SELECT * FROM test_export" outputFormat="html" outputFile="target/catalog_test_003.html" createPath="1"/>
77
<query id="Q004" sql="SELECT * FROM test_export" outputFormat="xls" outputFile="target/catalog_test_004.xls" xlsResize="1"/>
88
<query id="Q005" sql="SELECT * FROM test_export" outputFormat="xlsx" outputFile="target/catalog_test_004.xlsx" xlsTemplate="src/test/resources/template/test_template.xlsx" />
9+
<query id="Q006" queryFile="src/test/resources/sample/sample-query.sql" outputFormat="xlsx" outputFile="target/catalog_test_006.xlsx" />
910
</query-catalog>
1011

1112
<query-catalog id="fail-catalog">

0 commit comments

Comments
 (0)