-
Notifications
You must be signed in to change notification settings - Fork 16
SQLEP 1.7.4 Tutorial
###The tutorial is updated for SQLEP 1.7.4+
###Introduction The new features of the SQL Processor Eclipse Plugin (SQLEP) version 1.7.4 are
- new control directive database-take-comments
- default DAO constructor
- new control directive pojogen-generate-validation-annotations
- extended POJO grammar - implements directive with exceptPojos and onlyPojos
- extended DAO grammar - implements directive with exceptDaos and onlyDaos
It's possible to take comments in DB into generated pojo.qry
using the new control directive
database-take-comments;
In can be seen in the HSQLDB based sample [https://github.com/hudec/sql-processor/blob/master/simple-samples/simple-hsqldb/src/main/resources/pojo.qry]
It's possible to generated some validation annotations in pojo.qry
using the new control directive
pojogen-generate-validation-annotations;
For the NOT NULL database columns (=required attributes) the annotation javax.validation.constraints.NotNull
is taken. For the VARCHAR database columns the annotation javax.validation.constraints.Size
with the max length is taken. In can be seen in the HSQLDB based sample [https://github.com/hudec/sql-processor/blob/master/simple-samples/simple-hsqldb/src/main/resources/pojo.qry]
The generated annotations can help in the process of dynamic input form validations - the new SQLP 2.2.5 experimental feature.
Using for example in pojo.qry
the next directive
implements java.io.Closeable
we can force all generated POJO classes have to implement this interface. Now we can restrict the feature only for selected POJOs using
implements java.io.Closeable onlyPojos Pojo1 Pojo2
or we can use a negative selection
implements java.io.Closeable exceptPojos Pojo1 Pojo2
The same is true for the directive extends
extends java.lang.Object onlyPojos Pojo1 Pojo2
or
extends java.lang.Object exceptPojos Pojo1 Pojo2
Using for example in dao.qry
the next directive
implements java.io.Closeable
we can force all generated DAO classes have to implement this interface. Now we can restrict the feature only for selected DAOs using
implements java.io.Closeable onlyDaos Dao1 Dao2
or we can use a negative selection
implements java.io.Closeable exceptDaos Dao1 Dao2
The same is true for the directive extends
extends mypackage.BaseDao onlyDaos Dao1 Dao2
or
extends mypackage.BaseDao exceptDaos Dao1 Dao2
- 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