From ef35f9057f8667965c44cf3001bc37703ccf15c1 Mon Sep 17 00:00:00 2001 From: "Matteo Franci a.k.a. Fugerit" Date: Fri, 25 Aug 2023 13:16:56 +0200 Subject: [PATCH] 1.1.1 (2023-08-25) + [enhancement] [fj-daogen]added documentation [1.1.1-rc.2] + [enhancement] [fj-daogen-maven-plugin]added site and documentatin [1.1.1-rc.2] + [enhancement] [fj-daogen-maven-plugin]added handling of parameters generator-catalog and decorator-catalog [1.1.1-rc.2] + [enhancement] updated fj-bom to 1.2.4 [1.1.1-rc.1] + [enhancement] fixed sonar cloud issues [1.1.1-rc.1] + [enhancement] [fj-daogen-tool] main class moved from default package to tool.Daogen [1.1.1-rc.1] --- README.md | 22 ++++- docgen/release-notes.txt | 3 +- docs/dao_dump.md | 7 ++ docs/dao_gen.md | 7 ++ fj-daogen-base/README.md | 16 ++++ fj-daogen-base/pom.xml | 2 +- fj-daogen-maven-plugin/README.md | 1 + fj-daogen-maven-plugin/pom.xml | 2 +- fj-daogen-sample/README.md | 15 ++++ fj-daogen-sample/pom.xml | 2 +- fj-daogen-tool/README.md | 33 ++++++++ fj-daogen-tool/pom.xml | 15 +++- .../src/main/resources/log4j.properties | 4 - fj-daogen-tool/src/main/resources/log4j2.xml | 13 +++ .../resources/db-config-sample.properties | 5 ++ .../fugerit-daogen-config-sample.xml | 83 +++++++++++++++++++ index.md | 7 +- pom.xml | 2 +- 18 files changed, 226 insertions(+), 13 deletions(-) create mode 100644 docs/dao_dump.md create mode 100644 docs/dao_gen.md create mode 100644 fj-daogen-base/README.md create mode 100644 fj-daogen-sample/README.md create mode 100644 fj-daogen-tool/README.md delete mode 100644 fj-daogen-tool/src/main/resources/log4j.properties create mode 100644 fj-daogen-tool/src/main/resources/log4j2.xml create mode 100644 fj-daogen-tool/src/test/resources/db-config-sample.properties create mode 100644 fj-daogen-tool/src/test/resources/fugerit-daogen-config-sample.xml diff --git a/README.md b/README.md index 363e758f..254addb0 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,6 @@ Framework for generating model and persistence A.P.I. Provides tools for dumping configuration from relational database. A [quickstart](https://github.com/fugerit-org/fj-daogen-quickstart) is available too. -[![Maven Central](https://img.shields.io/maven-central/v/org.fugerit.java/fj-daogen-base.svg)](https://mvnrepository.com/artifact/org.fugerit.java/fj-daogen-base) - **Note : Starting from version 0.4+, minimum required java version changed to 1.8** Useful resources : [github pages documentation](https://marsdocs.fugerit.org/) | [project home page](https://www.fugerit.org/perm/mars) | docgen [home](https://www.fugerit.org/data/java/doc/mars/index.html) | [release notes](https://www.fugerit.org/data/java/doc/mars/release-notes.html) | [Doagen Maven Plugin Site](https://docs.fugerit.org/data/java/site/fj-daogen-maven-plugin/generate-mojo.html) @@ -14,4 +12,24 @@ Useful resources : [github pages documentation](https://marsdocs.fugerit.org/) | Javadoc are far from being complete, but you can find latest version at [https://www.fugerit.org](https://www.fugerit.org/data/java/javadoc/) Note that, being an open source project hosted on maven central, you can find release javadoc on [javadoc.io](https://javadoc.io/doc/org.fugerit.java/fj-daogen-base/) +*Description* +This project provides code generation API, especially for persistence (DAO). But can be used to generate other item too. +There are two basic feature supplied by the library : +1. [DAO Configuration dump](docs/dao_dump.md), this is optional, it provides a configuration dump for the 'DAO Generation' feature. +2. [DAO Generation](docs/dao_gen.md), this is the main feature, it generates various items based on a configuration file, named 'daogen-config.xml' (see a [sample daogen-config-xml](fj-daogen-sample/src/main/daogen/fugerit-sample-daogen-config.xml)) + +## [fj-daogen-base](fj-daogen-base/README.md) the core module +This modules contains core functionalities of the library : 'DAO Configuration dump' and 'DAO Generation' [![Maven Central](https://img.shields.io/maven-central/v/org.fugerit.java/fj-daogen-base.svg)](https://mvnrepository.com/artifact/org.fugerit.java/fj-daogen-base) + +## [fj-daogen-maven-plugin](fj-daogen-maven-plugin/README.md) a maven plugin for the [fj-daogen-base](fj-daogen-base/README.md) functionalities +This plugin contains simple mojos for handling dao generation and dao configuration dump. [![Maven Central](https://img.shields.io/maven-central/v/org.fugerit.java/fj-daogen-maven-plugin.svg)](https://mvnrepository.com/artifact/org.fugerit.java/fj-daogen-maven-plugin) + +## [fj-daogen-sample](fj-daogen-sample/README.md) a demo project for [fj-daogen-base](fj-daogen-base/README.md) and [fj-daogen-maven-plugin](fj-daogen-maven-plugin/README.md) +This projects can be used as a demo for the main features (dao generation and configuration dump) of the other modules. [![Maven Central](https://img.shields.io/maven-central/v/org.fugerit.java/fj-daogen-samplesvg)](https://mvnrepository.com/artifact/org.fugerit.java/fj-daogen-sample) + +## [fj-daogen-tool](fj-daogen-tool/README.md) tool wrapper +Simple tool wrapper for dao generation and configuration dump features. [![Maven Central](https://img.shields.io/maven-central/v/org.fugerit.java/fj-daogen-tool.svg)](https://mvnrepository.com/artifact/org.fugerit.java/fj-daogen-tool) + +## Sonar Cloud quality gate + [![Quality gate](https://sonarcloud.io/api/project_badges/quality_gate?project=fugerit-org_fj-daogen)](https://sonarcloud.io/summary/new_code?id=fugerit-org_fj-daogen) diff --git a/docgen/release-notes.txt b/docgen/release-notes.txt index fb13c59c..2138feff 100644 --- a/docgen/release-notes.txt +++ b/docgen/release-notes.txt @@ -1,5 +1,6 @@ -1.1.1 (next) +1.1.1 (2023-08-25) ------------------ ++ [enhancement] [fj-daogen]added documentation [1.1.1-rc.2] + [enhancement] [fj-daogen-maven-plugin]added site and documentatin [1.1.1-rc.2] + [enhancement] [fj-daogen-maven-plugin]added handling of parameters generator-catalog and decorator-catalog [1.1.1-rc.2] + [enhancement] updated fj-bom to 1.2.4 [1.1.1-rc.1] diff --git a/docs/dao_dump.md b/docs/dao_dump.md new file mode 100644 index 00000000..8ad41a4c --- /dev/null +++ b/docs/dao_dump.md @@ -0,0 +1,7 @@ +[Docs Home](../index.md) + +## DAO Configuration dump + +This features allow a configuration dump, creating a stub daogen-config.xml file to use as a base for configuring [DAO Generation](dao_gen.md). + +The dump is based on a database schema reverse engineering through JDBC Metadata API. \ No newline at end of file diff --git a/docs/dao_gen.md b/docs/dao_gen.md new file mode 100644 index 00000000..bc0a4016 --- /dev/null +++ b/docs/dao_gen.md @@ -0,0 +1,7 @@ +[Docs Home](../index.md) + +## DAO Generation + +The main feature of this library, actually generates all the items configured in daoge-config.xml (see a [sample daogen-config-xml](fj-daogen-sample/src/main/daogen/fugerit-sample-daogen-config.xml)) + +[See configuration reference](config/config.md) \ No newline at end of file diff --git a/fj-daogen-base/README.md b/fj-daogen-base/README.md new file mode 100644 index 00000000..11c9a736 --- /dev/null +++ b/fj-daogen-base/README.md @@ -0,0 +1,16 @@ +# Fugerit Mars DAO Generation (fj-daogen) + +## Daogen Maven Plugin (fj-daogen-maven-plugin) + +[back to fj-daogen index](../README.md) + +*Description* : +Allows to include the DAO generation in the maven build lifecycle. + +*Status* : +All basic features are implemented. + +*Since* : fj-doc 1.1.0 + +*Quickstart* : +See : [Daogen Maven Plugin Site](https://docs.fugerit.org/data/java/site/fj-daogen-maven-plugin/generate-mojo.html) \ No newline at end of file diff --git a/fj-daogen-base/pom.xml b/fj-daogen-base/pom.xml index 496aa647..f0c09b7c 100644 --- a/fj-daogen-base/pom.xml +++ b/fj-daogen-base/pom.xml @@ -7,7 +7,7 @@ org.fugerit.java fj-daogen - 1.1.1-rc.2 + 1.1.1 fj-daogen-base diff --git a/fj-daogen-maven-plugin/README.md b/fj-daogen-maven-plugin/README.md index 11c9a736..77f53583 100644 --- a/fj-daogen-maven-plugin/README.md +++ b/fj-daogen-maven-plugin/README.md @@ -13,4 +13,5 @@ All basic features are implemented. *Since* : fj-doc 1.1.0 *Quickstart* : + See : [Daogen Maven Plugin Site](https://docs.fugerit.org/data/java/site/fj-daogen-maven-plugin/generate-mojo.html) \ No newline at end of file diff --git a/fj-daogen-maven-plugin/pom.xml b/fj-daogen-maven-plugin/pom.xml index c1b490c8..06f4cf21 100644 --- a/fj-daogen-maven-plugin/pom.xml +++ b/fj-daogen-maven-plugin/pom.xml @@ -7,7 +7,7 @@ org.fugerit.java fj-daogen - 1.1.1-rc.2 + 1.1.1 maven-plugin diff --git a/fj-daogen-sample/README.md b/fj-daogen-sample/README.md new file mode 100644 index 00000000..6b53858c --- /dev/null +++ b/fj-daogen-sample/README.md @@ -0,0 +1,15 @@ +# Fugerit Mars DAO Generation (fj-daogen) + +## Daogen Sample (fj-daogen-sample) + +[back to fj-daogen index](../README.md) + +*Description* : +Sample usage sample of the core library and the maven plugin. + +*Status* : +All basic features are implemented. + +*Since* : fj-doc 1.0.0 + +*Quickstart* : Not meant to be imported, but just as a quickstart and playground. diff --git a/fj-daogen-sample/pom.xml b/fj-daogen-sample/pom.xml index 23ea3229..a35022a7 100644 --- a/fj-daogen-sample/pom.xml +++ b/fj-daogen-sample/pom.xml @@ -7,7 +7,7 @@ org.fugerit.java fj-daogen - 1.1.1-rc.2 + 1.1.1 fj-daogen-sample diff --git a/fj-daogen-tool/README.md b/fj-daogen-tool/README.md new file mode 100644 index 00000000..76daede5 --- /dev/null +++ b/fj-daogen-tool/README.md @@ -0,0 +1,33 @@ +# Fugerit Mars DAO Generation (fj-daogen) + +## Daogen Sample (fj-daogen-sample) + +[back to fj-daogen index](../README.md) + +*Description* : +Sample tool wrapper for the [DAO Configuration dump](docs/dao_dump.md) and [DAO Generation](docs/dao_gen.md) features. + +*Status* : +All basic features are implemented. + +*Since* : fj-doc 1.0.0 + +*Quickstart* : + +### Build the project : + +`mvn clean install -P singlepackage` + +### For [DAO Configuration dump](../docs/dao_dump.md) + +`java -jar target/dist-fj-daogen-tool-X.X.X.jar --action dump --db-config [database connection confg] --daogen-config [path-to-output-file]` + +(For a sample db-config file see [db-config-sample.properties](src/test/resources/db-config-sample.properties)) + + +### For [DAO Generation](../docs/dao_gen.md) +`java -jar target/dist-fj-daogen-tool-X.X.X.jar --action daogen --daogen-config [path-to-input-file]` + +(see a [sample daogen-config-xml](src/test/resources/fugerit-daogen-config-sample.xml)) + + diff --git a/fj-daogen-tool/pom.xml b/fj-daogen-tool/pom.xml index 2ba093a1..b751efa4 100644 --- a/fj-daogen-tool/pom.xml +++ b/fj-daogen-tool/pom.xml @@ -7,7 +7,7 @@ org.fugerit.java fj-daogen - 1.1.1-rc.2 + 1.1.1 fj-daogen-tool @@ -37,6 +37,19 @@ fj-daogen-base + + org.apache.logging.log4j + log4j-api + + + org.apache.logging.log4j + log4j-core + + + org.apache.logging.log4j + log4j-slf4j2-impl + + diff --git a/fj-daogen-tool/src/main/resources/log4j.properties b/fj-daogen-tool/src/main/resources/log4j.properties deleted file mode 100644 index bc3911a6..00000000 --- a/fj-daogen-tool/src/main/resources/log4j.properties +++ /dev/null @@ -1,4 +0,0 @@ -log4j.rootLogger=INFO,CONSOLE -log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender -log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout -log4j.appender.CONSOLE.layout.ConversionPattern=[%d] - %m%n diff --git a/fj-daogen-tool/src/main/resources/log4j2.xml b/fj-daogen-tool/src/main/resources/log4j2.xml new file mode 100644 index 00000000..e6220f78 --- /dev/null +++ b/fj-daogen-tool/src/main/resources/log4j2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/fj-daogen-tool/src/test/resources/db-config-sample.properties b/fj-daogen-tool/src/test/resources/db-config-sample.properties new file mode 100644 index 00000000..cada84ff --- /dev/null +++ b/fj-daogen-tool/src/test/resources/db-config-sample.properties @@ -0,0 +1,5 @@ +db-cf-mode=DC +db-mode-dc-drv=org.hsqldb.jdbcDriver +db-mode-dc-url=jdbc:hsqldb:mem:base_db +db-mode-dc-usr=test_db +db-mode-dc-pwd=test_db \ No newline at end of file diff --git a/fj-daogen-tool/src/test/resources/fugerit-daogen-config-sample.xml b/fj-daogen-tool/src/test/resources/fugerit-daogen-config-sample.xml new file mode 100644 index 00000000..bb52dd64 --- /dev/null +++ b/fj-daogen-tool/src/test/resources/fugerit-daogen-config-sample.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/index.md b/index.md index 1f763203..9ef2983f 100644 --- a/index.md +++ b/index.md @@ -4,4 +4,9 @@ ## Index -* [Configuration reference](docs/config/config.md) \ No newline at end of file +* [Project README](README.md) +* [DAO Configuration dump](docs/dao_dump.md) feature +* [DAO Generation](docs/dao_gen.md) feature +* [Configuration reference](docs/config/config.md) + + diff --git a/pom.xml b/pom.xml index a2ca7d98..3a93b873 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ fj-daogen - 1.1.1-rc.2 + 1.1.1 pom fj-daogen