https://github.com/sassine/sqlschema2java
sqlschema2java generates Java types from SQLSchema and annotate those types for data-binding with Jackson 2.x, Javax Persistence and Spring Repository.
https://github.com/sassine/sqlschema2java
antlr4 class classloader dto dto-entity-mapper entity jackson java java-library jpa-hibernate lombok maven maven-plugin reflection sql sql-schema
Last synced: 3 months ago
JSON representation
sqlschema2java generates Java types from SQLSchema and annotate those types for data-binding with Jackson 2.x, Javax Persistence and Spring Repository.
- Host: GitHub
- URL: https://github.com/sassine/sqlschema2java
- Owner: Sassine
- License: mit
- Created: 2022-03-28T22:25:19.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-11-30T14:56:43.000Z (over 1 year ago)
- Last Synced: 2024-11-13T15:56:37.415Z (8 months ago)
- Topics: antlr4, class, classloader, dto, dto-entity-mapper, entity, jackson, java, java-library, jpa-hibernate, lombok, maven, maven-plugin, reflection, sql, sql-schema
- Language: Java
- Homepage: https://sassine.dev
- Size: 167 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Funding: .github/funding.yml
- License: LICENSE
Awesome Lists containing this project
README
# SQLSchema2Java [](https://github.com/ellerbrock/open-source-badges/)
[](https://coveralls.io/github/Sassine/sqlschema2java?branch=main)
[](https://github.com/Sassine/sqlschema2java/actions/workflows/codeql-analysis.yml)

_sqlschema2java_ generates Java types from SQLSchema and annotate those types for data-binding with Jackson 2.x, Javax Persistence and Spring Repository.

You can use sqlschema2java as a Maven plugin.
[**Try at the sample project exemple**](https://github.com/Sassine/sqlschema2java/tree/main/sqlschema2java-example)[**Read Getting Started**](https://github.com/Sassine/sqlschema2java/wiki/Getting-Started)
## Implementation
#### A very simple Maven example:
```xml
pom.xml
dev.sassine.api
sqlschema2java-maven-plugin
1.0.0-beta
generate
./example.sql
dev.sassine.api
true
false
```
### Parameters
| Name | required | type | description |
|--|--|--|--|
| sourceDirectory | true | String | SQL file path |
| packageName | true | String | package name with points that will be generated |
| useAutoIncrement| false | Boolean| disable or enable whether the primary key will have its value generated automatically |
| usePostgreSQL | true | Boolean | disable or enable query conversion compatible with postgres database |##### Run command
```bash
mvn dev.sassine.api:sqlschema2java-maven-plugin:generate
```
Successful ✨## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.Please make sure to update tests as appropriate.
[](https://ko-fi.com/P5P8C2H8Q)
## License
[](https://github.com/Sassine/sqlschema2java/blob/master/LICENSE)