https://github.com/felipeaz/sqlquery-creator
Create a SQL query from a JSON file
https://github.com/felipeaz/sqlquery-creator
challenge java sql
Last synced: 3 months ago
JSON representation
Create a SQL query from a JSON file
- Host: GitHub
- URL: https://github.com/felipeaz/sqlquery-creator
- Owner: felipeaz
- Created: 2021-05-29T19:44:19.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-05-30T18:55:44.000Z (almost 4 years ago)
- Last Synced: 2025-01-07T05:22:03.754Z (4 months ago)
- Topics: challenge, java, sql
- Language: Java
- Homepage:
- Size: 76.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sqlQuery-creator
sqlQuery-creator is a command line application which transforms a JSON file into a SQL Query. This project have been built using the concept of ``Domain`` from Domain Driven Design (DDD). A domain represents a ``context`` on the application and it's functionality is only related to it's context.
``This application is built using JDK 16``
### Dependencies
Maven is required to run this project. You can install it using the following command:
``apt install maven``
This project was built using Maven to manage the application dependencies. The dependency used on this project was ``com.googlecode.json-simple`` to manipulate JSON data.
### Instructions
To run this application, make sure you have installed maven on your computer, if so, follow the commands bellow:
``make run`` - initialize the application
### Directories
| Dir |Content|
| --- | --- |
| src | Application folder |
| domain | Contains the application modules which were divided in two items: Json and Query |
| Json | Contains every action that is related to the JSON file |
| Query | Contains every action that is responsible to the Query Creation |
| Utils | Functions that can be util to the current module. |
| Service | Contains the domain's logic. |
| Entity | Contains information about a domain item |
| Exception | Represents domain's exceptions |
| Main | Contains the application main file |### JSON Example
````
{
"columns":[
{
"operator":"Between",
"fieldName":"Age",
"fieldValue":[
"25",
"30"
]
},
{
"operator":"Equal",
"fieldName":"Role",
"fieldValue":[
"Software Engineer"
]
},
{
"operator":"GreaterThanOrEqual",
"fieldName":"Salary",
"fieldValue":[
"99999.99"
]
},
{
"operator":"Like",
"fieldName":"Name",
"fieldValue":[
"a"
]
}
]
}
````