-
Notifications
You must be signed in to change notification settings - Fork 16
SQLEP standalone generator
Vladimír Hudec edited this page Apr 17, 2019
·
14 revisions
SQLEP standalone is a clone of SQL Processor Eclipse Plugin, which can be used outside of the IDE.
Basic command line usage
Extended command line usage
Maven usage
java -jar sqlep.jar -models modelsFile1,modelsFile2... [-source sourceDir] [-target targetDir] [-verify]
For example:
java -jar sqlep.jar -models pojo.qry,dao.qry -target src-gen
Mode 2: POJO, DAO and META SQL models generation using control directives:
java -jar sqlep.jar -control controlDirectivesFile -pojo pojoModelsFile -dao daoModelsFile -sql metaSqlsFile [-ddl ddlsFile] [-source sourceDir] [-target targetDir] [-nomerge]
For example:
java -jar sqlep.jar -control definitions.qry -pojo pojo.qry -dao dao.qry -sql statements.qry
Arguments:
-
-models filename[.filename]
- comma separated list of model files names (eg. pojo.qry,dao.qry) -
-target dirname
- a target directory (eg. src-gen) -
-source dirname
- a source directory (eg. src/main/resources) -
-control filename
- a control directives file name -
-pojo filename
- a POJO models file name -
-dao filename
- a DAO models file name -
-sql filename
- a META SQLs file name -
-ddl filename
- a DDLs file name -
-nomerge
- do not merge generated artefacts with existing ones -
-verify
- do not generate Java source files, only verify models files
java -cp sqlep.jar:hsqldb-2.3.2.jar:validation-api-1.1.0.Final.jar org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader -control definitions.qry -pojo pojo.qry -dao dao.qry -sql statements.qry -ddl hsqldb.ddl -nomerge -source src/main/resources -target src/main/resources
and
java -cp sqlep.jar:hsqldb-2.3.2.jar:validation-api-1.1.0.Final.jar org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader -models pojo.qry,dao.qry -source src/main/resources -target src-gen
curl -O http://sql-processor.eu/sqlep.jar
mvn install:install-file -Dfile=sqlep.jar -DgroupId=org.sqlproc.dsl -DartifactId=sqlep -Dversion=1.9.2 -Dpackaging=jar
Next we can modify pom.xml - we'll add two profiles
<profiles>
<profile>
<id>db2mo</id>
<dependencies>
<dependency>
<groupId>org.sqlproc.dsl</groupId>
<artifactId>sqlep</artifactId>
<version>1.9.2</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<executable>java</executable>
<classpathScope>runtime</classpathScope>
<arguments>
<argument>-classpath</argument>
<classpath>
<dependency>org.sqlproc.dsl:sqlep</dependency>
<dependency>org.hsqldb:hsqldb</dependency>
<dependency>javax.validation:validation-api</dependency>
</classpath>
<argument>org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader</argument>
<argument>-control</argument>
<argument>definitions.qry</argument>
<argument>-pojo</argument>
<argument>pojo.qry</argument>
<argument>-dao</argument>
<argument>dao.qry</argument>
<argument>-sql</argument>
<argument>statements.qry</argument>
<argument>-ddl</argument>
<argument>hsqldb.ddl</argument>
<argument>-source</argument>
<argument>src/main/resources</argument>
<argument>-target</argument>
<argument>src/main/resources</argument>
<argument>-nomerge</argument>
</arguments>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>mo2ja</id>
<dependencies>
<dependency>
<groupId>org.sqlproc.dsl</groupId>
<artifactId>sqlep</artifactId>
<version>1.9.2</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<executable>java</executable>
<classpathScope>runtime</classpathScope>
<arguments>
<argument>-classpath</argument>
<classpath>
<dependency>org.sqlproc.dsl:sqlep</dependency>
<dependency>org.hsqldb:hsqldb</dependency>
<dependency>javax.validation:validation-api</dependency>
</classpath>
<argument>org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader</argument>
<argument>-models</argument>
<argument>pojo.qry,dao.qry</argument>
<argument>-source</argument>
<argument>src/main/resources</argument>
<argument>-target</argument>
<argument>src-gen</argument>
</arguments>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
The profile db2mo
can be used to generate artefacts pojo.qry
, dao.qry
and statements.qry
from DB layout (created using hsqldb.ddl
) using the control directives in `definitions.qry'
mvn -P db2mo exec:exe
The parameter -nomerge
is used to overwrite existing artefacts files.
The profile mo2ja
can be used to generate Java source files from the models pojo.qry
and dao.qry
mvn -P mo2ja exec:exec
- SQL Processor Home
- SQL Processor News
- SQL Processor Eclipse Plugin Home
- SQL Processor Eclipse Plugin News
- SQL Processor Architecture
- SQLP and SQLM*P Tutorials
- SQLM*P Control directives
- Basic Tutorials
- 10 minutes Tutorial
- Simple Tutorial
- CRUD Tutorial
- Associations Tutorial
- Inheritance Tutorial
- More inheritance Tutorial
- Custom Types Tutorial
- Stored procedures Tutorial
- IDE Setup and Coding Standards
- Catalog (JPA) Sample
- Catalog (Hibernate) Sample
- Catalog (Spring) Sample
- Advanced catalog (Spring) Sample
- The Reference Guide
- The Eclipse Plugin Tutorials
- The Improvements
- Tutorials archive