Skip to content

Commit

Permalink
1.1.1 (2023-08-25)
Browse files Browse the repository at this point in the history
+ [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]
  • Loading branch information
fugerit79 committed Aug 25, 2023
1 parent 41608bd commit ef35f90
Show file tree
Hide file tree
Showing 18 changed files with 226 additions and 13 deletions.
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
3 changes: 2 additions & 1 deletion docgen/release-notes.txt
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
7 changes: 7 additions & 0 deletions docs/dao_dump.md
Original file line number Diff line number Diff line change
@@ -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.
7 changes: 7 additions & 0 deletions docs/dao_gen.md
Original file line number Diff line number Diff line change
@@ -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)
16 changes: 16 additions & 0 deletions fj-daogen-base/README.md
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion fj-daogen-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.fugerit.java</groupId>
<artifactId>fj-daogen</artifactId>
<version>1.1.1-rc.2</version>
<version>1.1.1</version>
</parent>

<name>fj-daogen-base</name>
Expand Down
1 change: 1 addition & 0 deletions fj-daogen-maven-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion fj-daogen-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.fugerit.java</groupId>
<artifactId>fj-daogen</artifactId>
<version>1.1.1-rc.2</version>
<version>1.1.1</version>
</parent>

<packaging>maven-plugin</packaging>
Expand Down
15 changes: 15 additions & 0 deletions fj-daogen-sample/README.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion fj-daogen-sample/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.fugerit.java</groupId>
<artifactId>fj-daogen</artifactId>
<version>1.1.1-rc.2</version>
<version>1.1.1</version>
</parent>

<name>fj-daogen-sample</name>
Expand Down
33 changes: 33 additions & 0 deletions fj-daogen-tool/README.md
Original file line number Diff line number Diff line change
@@ -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))


15 changes: 14 additions & 1 deletion fj-daogen-tool/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.fugerit.java</groupId>
<artifactId>fj-daogen</artifactId>
<version>1.1.1-rc.2</version>
<version>1.1.1</version>
</parent>

<name>fj-daogen-tool</name>
Expand Down Expand Up @@ -37,6 +37,19 @@
<artifactId>fj-daogen-base</artifactId>
</dependency>

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j2-impl</artifactId>
</dependency>

</dependencies>

<organization>
Expand Down
4 changes: 0 additions & 4 deletions fj-daogen-tool/src/main/resources/log4j.properties

This file was deleted.

13 changes: 13 additions & 0 deletions fj-daogen-tool/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
</Console>
</Appenders>
<Loggers>
<Root level="DEBUG">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>
5 changes: 5 additions & 0 deletions fj-daogen-tool/src/test/resources/db-config-sample.properties
Original file line number Diff line number Diff line change
@@ -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
83 changes: 83 additions & 0 deletions fj-daogen-tool/src/test/resources/fugerit-daogen-config-sample.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<daogen-config
base-src-folder="../fj-daogen-sample"
database-type="oracle"
gen-version="1.0.0"
gen-author="fugerit"
src-main-java="src/main/java"
src-test-java="src/test/java"
src-main-resources="src/main/resources"
src-test-resources="src/test/resources"
src-helpers="SRC-MAIN-JAVA"
src-doc-openapi="src/main/doc/openapi_rest"
class-config="cl://config/daogen_default_class_config.xml"
type-mapper="org.fugerit.java.daogen.base.config.DaogenTypeMapper"
type-map-config="cl://config/daogen_default_type_mapping.xml"
generator-catalog="cl://config/default-generator-catalog.xml"
decorator-catalog="cl://config/default-decorator-catalog.xml"
default-column-time-insert="DATE_INSERT"
default-column-time-update="DATE_UPDATE"
struct_prefix="OBJ_"
package-model="org.fugerit.java.daogen.sample.def.model"
package-helper="org.fugerit.java.daogen.sample.impl.helper"
package-struct="org.fugerit.java.daogen.sample.impl.struct"
package-rse="org.fugerit.java.daogen.sample.impl.rse"
package-facade-def="org.fugerit.java.daogen.sample.def.facade"
package-facade-data-impl="org.fugerit.java.daogen.sample.impl.facade.data"
package-rest-load="org.fugerit.java.daogen.sample.impl.rest.load"
base-rest-service="org.fugerit.java.daogen.sample.helper.ServiceProviderHelper"
factory-def="org.fugerit.java.daogen.sample.def.facade.FugeritLogicFacade"
factory-data-impl="org.fugerit.java.daogen.sample.impl.facade.data.FugeritDataLogicFacade"
default-sequence="seq_id_fugerit"
openapi_host="http://localhost:9080"
openapi_path="/fugerit-sample-web/jax-rs"
check-empty-interface="1"
>

<relation id="userToAddress" name="USER_ADDRESSES" from="PUBLIC.FUGERIT.USER" to="PUBLIC.FUGERIT.ADDRESS" mode="many" key="ID_USER"/>
<relation id="addressToUser" name="USER" from="PUBLIC.FUGERIT.ADDRESS" to="PUBLIC.FUGERIT.USER" mode="one" key="ID_USER"/>

<entity catalog="PUBLIC" comments="Contains users data" id="PUBLIC.FUGERIT.USER" name="USER" primaryKey="ID" schema="FUGERIT">
<field comments="User system id" id="ID" javaType="java.lang.Long" nullable="no" size="0" sqlType="-5" sqlTypeName="BIGINT"/>
<field comments="User chosen id" id="USERNAME" javaType="java.lang.String" nullable="no" size="128" sqlType="12" sqlTypeName="VARCHAR"/>
<field comments="Password hash" id="PASSWORD" javaType="java.lang.String" nullable="no" size="128" sqlType="12" sqlTypeName="VARCHAR"/>
<field comments="Time of last user login" id="LAST_LOGIN" javaType="java.sql.Timestamp" nullable="yes" size="0" sqlType="93" sqlTypeName="TIMESTAMP"/>
<field comments="" id="DATE_INSERT" javaType="java.sql.Timestamp" nullable="yes" size="0" sqlType="93" sqlTypeName="TIMESTAMP"/>
<field comments="" id="DATE_UPDATE" javaType="java.sql.Timestamp" nullable="yes" size="0" sqlType="93" sqlTypeName="TIMESTAMP"/>
<field comments="1 active, 0 not active" id="STATE" javaType="java.lang.Integer" nullable="no" size="0" sqlType="4" sqlTypeName="INTEGER"/>
</entity>
<entity catalog="PUBLIC" comments="Contains addresses data" foreignKeys="PUBLIC.FUGERIT.USER" id="PUBLIC.FUGERIT.ADDRESS" name="ADDRESS" primaryKey="ID" schema="FUGERIT">
<field comments="Address system id" id="ID" javaType="java.lang.Long" nullable="no" size="0" sqlType="-5" sqlTypeName="BIGINT"/>
<field comments="User linked to to address" id="ID_USER" javaType="java.lang.Long" nullable="no" size="0" sqlType="-5" sqlTypeName="BIGINT"/>
<field comments="" id="DATE_INSERT" javaType="java.sql.Timestamp" nullable="yes" size="0" sqlType="93" sqlTypeName="TIMESTAMP"/>
<field comments="" id="DATE_UPDATE" javaType="java.sql.Timestamp" nullable="yes" size="0" sqlType="93" sqlTypeName="TIMESTAMP"/>
<field comments="Address info" id="INFO" javaType="java.lang.String" nullable="no" size="256" sqlType="12" sqlTypeName="VARCHAR"/>
</entity>
<entity catalog="PUBLIC" comments="Contains upload blob" id="PUBLIC.FUGERIT.UPLOAD" name="UPLOAD" primaryKey="ID" schema="FUGERIT">
<field comments="" id="ID" javaType="java.lang.Long" nullable="no" size="0" sqlType="-5" sqlTypeName="BIGINT"/>
<field comments="" id="DATE_INSERT" javaType="java.sql.Timestamp" nullable="yes" size="0" sqlType="93" sqlTypeName="TIMESTAMP"/>
<field comments="" id="DATE_UPDATE" javaType="java.sql.Timestamp" nullable="yes" size="0" sqlType="93" sqlTypeName="TIMESTAMP"/>
<field comments="" id="CONTENT" javaType="java.sql.Blob" nullable="yes" size="1073741824" sqlType="2004" sqlTypeName="BLOB"/>
</entity>
<entity catalog="PUBLIC" id="PUBLIC.FUGERIT.LOG_DATA" name="LOG_DATA" schema="FUGERIT">
<field comments="" id="ID" javaType="java.lang.Long" nullable="no" size="0" sqlType="-5" sqlTypeName="BIGINT"/>
<field comments="" id="LOG_TIME" javaType="java.sql.Timestamp" nullable="yes" size="0" sqlType="93" sqlTypeName="TIMESTAMP"/>
<field comments="" id="INFO" javaType="java.lang.String" nullable="no" size="128" sqlType="12" sqlTypeName="VARCHAR"/>
</entity>
<entity catalog="PUBLIC" id="PUBLIC.FUGERIT.TEST_TWO_FIELD_KEY" name="TEST_TWO_FIELD_KEY" primaryKey="ID_ONE,ID_TWO" schema="FUGERIT">
<field comments="" id="ID_ONE" javaType="java.lang.Long" nullable="no" size="0" sqlType="-5" sqlTypeName="BIGINT"/>
<field comments="" id="ID_TWO" javaType="java.lang.Long" nullable="no" size="0" sqlType="-5" sqlTypeName="BIGINT"/>
<field comments="" id="INFO" javaType="java.lang.String" nullable="no" size="128" sqlType="12" sqlTypeName="VARCHAR"/>
</entity>

<entity catalog="PUBLIC" comments="Contains users data" id="PUBLIC.FUGERIT.USER_DATA" name="USER_DATA" primaryKey="ID" schema="FUGERIT" mapToTable="USER">
<field comments="User system id" id="ID" javaType="java.lang.Long" nullable="no" size="0" sqlType="-5" sqlTypeName="BIGINT"/>
<field comments="User chosen id" id="USERNAME" javaType="java.lang.String" nullable="no" size="128" sqlType="12" sqlTypeName="VARCHAR"/>
<field comments="Password hash" id="PASSWORD" javaType="java.lang.String" nullable="no" size="128" sqlType="12" sqlTypeName="VARCHAR"/>
<field comments="Time of last user login" id="LAST_LOGIN" javaType="java.sql.Timestamp" nullable="yes" size="0" sqlType="93" sqlTypeName="TIMESTAMP"/>
<field comments="" id="DATE_INSERT" javaType="java.sql.Timestamp" nullable="yes" size="0" sqlType="93" sqlTypeName="TIMESTAMP"/>
<field comments="" id="DATE_UPDATE" javaType="java.sql.Timestamp" nullable="yes" size="0" sqlType="93" sqlTypeName="TIMESTAMP"/>
<field comments="1 active, 0 not active" id="STATE" javaType="java.lang.Integer" nullable="no" size="0" sqlType="4" sqlTypeName="INTEGER"/>
</entity>


</daogen-config>
7 changes: 6 additions & 1 deletion index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@

## Index

* [Configuration reference](docs/config/config.md)
* [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)


2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<artifactId>fj-daogen</artifactId>

<version>1.1.1-rc.2</version>
<version>1.1.1</version>
<packaging>pom</packaging>

<name>fj-daogen</name>
Expand Down

0 comments on commit ef35f90

Please sign in to comment.