FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [View Raw Code]   [Original HTTPS Page]

sqlschema2java/README.md at develop · Sassine/sqlschema2java · GitHub

Latest commit

 

History

History
83 lines (61 loc) · 3.49 KB

File metadata and controls

83 lines (61 loc) · 3.49 KB

SQLSchema2Java

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

Read Getting Started

Implementation

A very simple Maven example:

pom.xml
 <plugins>
            <plugin>
                <groupId>dev.sassine.api</groupId>
                <artifactId>sqlschema2java-maven-plugin</artifactId>
                <version>1.0.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>sqlschema2java</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <sourceDirectory>/user/home/example.sql</sourceDirectory>
                    <packageName>dev.sassine.api</packageName>
                    <useAutoIncrement>true</useAutoIncrement>
                    <isPostgres>false</isPostgres>
                </configuration>
            </plugin>
</plugins>

<repositories>
	<repository>
		<id>github</id>
		<name>GitHub Packages SQLSchema2Java</name>
		<url>https://maven.pkg.github.com/Sassine/sqlschema2java</url>
	</repository>
</repositories>

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
isPostgres true Boolean disable or enable query conversion compatible with postgres database
Run command
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.

License


Back | FazBrowse Home | New Git URL