Created
October 18, 2016 12:37
-
-
Save elarif/c3262a6696c59235cb5e3bdbde28d2ea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test; | |
import java.io.File; | |
import java.io.IOException; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; | |
public class Main { | |
public static void main(String[] args) { | |
final ObjectMapper mapper = new ObjectMapper(new YAMLFactory()); | |
Queries queries = null; | |
try { | |
queries = mapper.readValue(new File("src/main/resources/queries.yml"), Queries.class); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} | |
System.out.println(queries.queryMonoligne); | |
System.out.println(queries.queryMultiligne); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>test</groupId> | |
<artifactId>test-sql-yaml</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<properties> | |
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | |
<jackson.version>2.8.3</jackson.version> | |
</properties> | |
<dependencies> | |
<dependency> | |
<groupId>com.fasterxml.jackson.dataformat</groupId> | |
<artifactId>jackson-dataformat-yaml</artifactId> | |
<version>${jackson.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>com.fasterxml.jackson.core</groupId> | |
<artifactId>jackson-databind</artifactId> | |
<version>${jackson.version}</version> | |
</dependency> | |
</dependencies> | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-compiler-plugin</artifactId> | |
<version>3.5.1</version> | |
<configuration> | |
<source>1.7</source> | |
<target>1.7</target> | |
</configuration> | |
</plugin> | |
</plugins> | |
</build> | |
</project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test; | |
public class Queries { | |
public String queryMonoligne; | |
public String queryMultiligne; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
queryMonoligne: | |
SELECT PJI.*, PJO.* | |
queryMultiligne: > | |
SELECT PJI.*, PJO.*, | |
CST.ABCGS | |
FROM dbo.Traverse AS TRE | |
LEFT OUTER JOIN dbo.TraversePreEntry AS TPE | |
ON TRE.JobNum = dbo.GetJobNumberFromGroupId(TPE.GroupId) | |
LEFT OUTER JOIN AutoCADProjectInformation AS PJI | |
ON TRE.JobNum = PJI.JobNumber | |
LEFT OUTER JOIN CalculationStorageReplacement AS CST | |
ON CST.ProjectNumber = dbo.GetJobNumberFromGroupId(TPE.GroupId | |
LEFT OUTER JOIN dbo.TraverseElevations AS TEV | |
ON TRE.TraverseId = TEV.TraverseId | |
LEFT OUTER JOIN VGSDB.dbo.ProjectOffice AS PJO | |
ON PJI.PjbId = PJO.PjbId | |
where jobnum = 1205992 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment