{"id":24617670,"url":"https://github.com/pacphi/externalized-query-example","last_synced_at":"2025-10-03T15:03:34.385Z","repository":{"id":48480910,"uuid":"101019029","full_name":"pacphi/externalized-query-example","owner":"pacphi","description":"This project employs Spring Boot and Spring Data JPA to demonstrate how to successfully read and execute a SQL statement by key from a properties file.","archived":false,"fork":false,"pushed_at":"2021-07-23T13:18:58.000Z","size":82,"stargazers_count":3,"open_issues_count":4,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-24T23:39:41.068Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pacphi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-22T03:52:55.000Z","updated_at":"2024-10-06T01:39:23.000Z","dependencies_parsed_at":"2022-09-03T09:40:21.112Z","dependency_job_id":null,"html_url":"https://github.com/pacphi/externalized-query-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pacphi%2Fexternalized-query-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pacphi%2Fexternalized-query-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pacphi%2Fexternalized-query-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pacphi%2Fexternalized-query-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pacphi","download_url":"https://codeload.github.com/pacphi/externalized-query-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244308675,"owners_count":20432248,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-24T23:39:52.191Z","updated_at":"2025-10-03T15:03:32.816Z","avatar_url":"https://github.com/pacphi.png","language":"Java","readme":"# Externalized Query Example\n\nThis project employs Spring Boot and Spring Data JPA to demonstrate how to successfully read and execute a SQL statement by key from a properties file.\n\n\n## Prerequisites\n\n* Java JDK 1.8u192 or better\n* Gradle 4.10.3\n\n\n## How to compile and run unit tests\n\n```\ngradle test\n```\n\n## How to publish artifact to local Maven repository\n\nThe `build.gradle` file includes the [maven-publish](https://docs.gradle.org/current/userguide/publishing_maven.html#publishing_maven:install) plugin which allows you to execute\n\n```\ngradle publishToMavenLocal\n```\n\nThis will publish the artifact and a [POM](https://maven.apache.org/pom.html#What_is_the_POM) file to your `.m2/repository` directory in a `{groupId}/{artifactId}/{version}` sub-directory.\n\n## Details\n\nWe annotate `CourseQueries` with [ConfigurationProperties](https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html#boot-features-external-config-loading-yaml) to encapsulate a namespace of `sql.course` queries found in `application.yml`\n\nWe define `CourseRepository` and have it extend the [CrudRepository](https://docs.spring.io/spring-data/data-commons/docs/1.6.1.RELEASE/reference/html/repositories.html#repositories.core-concepts) interface. We also define an additional query method using [conventions](https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#repositories.query-methods.query-creation).\n\nWe implement `CourseService` to demonstrate how to employ a [JdbcTemplate](https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/jdbc/core/JdbcTemplate.html#query-java.lang.String-java.lang.Object:A-org.springframework.jdbc.core.ResultSetExtractor-) to execute a query \n\nFinally we author a unit test for the aformentioned service. (Spring Boot Test is [helpful](https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-testing.html)).\n\nAn [in-memory](http://www.h2database.com/html/main.html) database is [initialized](https://docs.spring.io/spring-boot/docs/current/reference/html/howto-database-initialization.html#howto-initialize-a-database-using-hibernate) on startup.\n\n\n## Credits\n\n* Sayem Ahmed for [AttributeConverter](https://www.javacodegeeks.com/2017/03/dealing-javas-localdatetime-jpa.html) used to convert [LocalDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/LocalDateTime.html)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpacphi%2Fexternalized-query-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpacphi%2Fexternalized-query-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpacphi%2Fexternalized-query-example/lists"}