diff --git a/README.md b/README.md index 3d38623..1d1c328 100644 --- a/README.md +++ b/README.md @@ -1,57 +1,73 @@ -# Generic Repository -This project use JPA and generic specifications of Spring Data JPA to query and fetch data from relational database +[[/images/jdbc.png |"Jdbc"]] + +this interface is the implementation of JpaRepository of Spring Data And JPA and generic specifications of Spring Data +JPA to query any parameter, you can find know about it in {@link } +you must create an interface and extended of it then generate a bean of your interface and use all method that Spring +Data implement it And then you Access the Spring Data Query Method and Used It in your Interface + +## Requirement + +The library works with Java 8+, ladder Core 1.0.1+ and implemented Crud Project + +## [Core](https://github.com/nimamoosavi/core/wiki) + +## [Crud](https://github.com/nimamoosavi/crud/wiki) -## Use To Use this library in your project add dependencies in maven: + ```xml + - app.ladderproject - crud - 0.0.1-SNAPSHOT + app.ladderproject + crud + 0.0.1-SNAPSHOT - app.ladderproject - Jdbc-client - 0.0.1-SNAPSHOT +app.ladderproject +Jdbc-client +0.0.1-SNAPSHOT ``` + > $ git clone https://github.com/nimamoosavi/jdbc-client.git > $ cd jdbc-clients > $ mvn clean install ## Operations + This table shows a list of the current supported operations. -| Operation | Code | +| Operation | Code | | ------------------------ | ---- | -| equal | EQUALS | -| not equal | NOT_EQUALS | -| greater than | GREATER_THAN | +| equal | EQUALS | +| not equal | NOT_EQUALS | +| greater than | GREATER_THAN | | greater than or equal to | GREATER_OR_EQUALS | -| less than | LESS_THAN | -| less than or equal to | LESS_OR_EQUALS | -| in | CONTAINS | -| start with | GREATER_THAN | +| less than | LESS_THAN | +| less than or equal to | LESS_OR_EQUALS | +| in | CONTAINS | +| start with | GREATER_THAN | | end with | END_WITH | -| not contain | NOT_CONTAIN | -| not start with | NOT_START_WITH | -| not end with | NOT_END_WITH | -| blank | BLANK | -| not blank | NOT_BLANK | -| null | NULL | -| not null | NOT_NULL | - - +| not contain | NOT_CONTAIN | +| not start with | NOT_START_WITH | +| not end with | NOT_END_WITH | +| blank | BLANK | +| not blank | NOT_BLANK | +| null | NULL | +| not null | NOT_NULL | ## Implementation + ### Using criteria object - To be able to custom filter you must just extend from our JdbcRepository: + +To be able to custom filter you must just extend from our JdbcRepository: ```java @Repository import app.ladderproject.sample.domain.entity.User; -import app.ladderproject.jdbcclient.repository.JdbcRepository; -import org.springframework.stereotype.Repository; + import app.ladderproject.jdbcclient.repository.JdbcRepository; + import org.springframework.stereotype.Repository; + public interface UserRepository extends JdbcRepository { } ``` @@ -60,13 +76,25 @@ if you extend from BaseController then call `http://localhost:8080/sample/v1/use ```json { - "criteria":{ + "criteria": { "operator": "EQUALS", "fieldName": "name", - "value": "John"}, - "sorts": ["name","lastName"] + "value": "John" + }, + "sorts": [ + "name", + "lastName" + ] } ``` -###TODOs + +### TODOs + * add operation for check operation like equality between two field * add condition on object like user.userInfo.age > 10 + +# Sample Project + +this project used Crud Project And Jdbc Project And Core And ... + +- [Sample Project](https://github.com/nimamoosavi/sample-project-crud)