{"id":23902726,"url":"https://github.com/mtumilowicz/spring-data-getone","last_synced_at":"2026-06-22T16:32:11.977Z","repository":{"id":110879353,"uuid":"144322858","full_name":"mtumilowicz/spring-data-getone","owner":"mtumilowicz","description":"The main goal of this project is to show how getOne works internally.","archived":false,"fork":false,"pushed_at":"2018-08-24T22:13:55.000Z","size":79,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-20T02:15:44.027Z","etag":null,"topics":["jpa","spring-data","spring-data-jpa"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mtumilowicz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-08-10T19:03:56.000Z","updated_at":"2020-05-23T12:00:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"f147d109-4eac-462f-b937-d2af2c198974","html_url":"https://github.com/mtumilowicz/spring-data-getone","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mtumilowicz/spring-data-getone","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtumilowicz%2Fspring-data-getone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtumilowicz%2Fspring-data-getone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtumilowicz%2Fspring-data-getone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtumilowicz%2Fspring-data-getone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mtumilowicz","download_url":"https://codeload.github.com/mtumilowicz/spring-data-getone/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtumilowicz%2Fspring-data-getone/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34657892,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-22T02:00:06.391Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["jpa","spring-data","spring-data-jpa"],"created_at":"2025-01-04T22:50:11.405Z","updated_at":"2026-06-22T16:32:11.971Z","avatar_url":"https://github.com/mtumilowicz.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.com/mtumilowicz/spring-data-getone.svg?branch=master)](https://travis-ci.com/mtumilowicz/spring-data-getone)\n# spring-data-getone\nThe main goal of this project is to show how `getOne` works internally.\n\n# preface\nAccording to JPA specification, we have two methods:\n* `EntityManager.find()` - query the database.\n* `EntityManager.getReference()` - load proxy (no database query), \n    throws `EntityNotFoundException` if entity doesn't exist in the database \n    (when synchronization with the database occurs).\n    \n# spring data\n* `Optional\u003cT\u003e findById(ID id)` - eager loading (internally `EntityManager.find()`)\n* `T getOne(ID id)` - lazy loading (internally `EntityManager.getReference()`)\n\n# project description\nWe enable query logging (`application.properties`):\n```\nspring.jpa.properties.hibernate.show_sql=true\n```\n\nand in `AppRunner` we simulate basic behaviour.\n\n# remarks\nIf you use `getOne` it loads proxy, but at first reference to any field - \nprovider loads the actual entity from database - so you have to still be\nin the persistence context.\n\n# tests\n**Coverage**: `96%`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtumilowicz%2Fspring-data-getone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmtumilowicz%2Fspring-data-getone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtumilowicz%2Fspring-data-getone/lists"}