{"id":19625901,"url":"https://github.com/leoando/roomjavasample","last_synced_at":"2026-06-10T18:31:40.838Z","repository":{"id":180109322,"uuid":"664602717","full_name":"LeoAndo/RoomJavaSample","owner":"LeoAndo","description":null,"archived":false,"fork":false,"pushed_at":"2023-07-14T15:16:52.000Z","size":222,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-05T20:55:28.753Z","etag":null,"topics":["android-java","android-livedata","android-room"],"latest_commit_sha":null,"homepage":"https://developer.android.com/training/data-storage/room","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/LeoAndo.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}},"created_at":"2023-07-10T10:44:28.000Z","updated_at":"2023-07-18T09:39:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"c84fee75-b9c7-4fe5-80fc-0f21535573fc","html_url":"https://github.com/LeoAndo/RoomJavaSample","commit_stats":null,"previous_names":["leoando/roomjavasample"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LeoAndo/RoomJavaSample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeoAndo%2FRoomJavaSample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeoAndo%2FRoomJavaSample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeoAndo%2FRoomJavaSample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeoAndo%2FRoomJavaSample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LeoAndo","download_url":"https://codeload.github.com/LeoAndo/RoomJavaSample/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeoAndo%2FRoomJavaSample/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34165482,"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-10T02:00:07.152Z","response_time":89,"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":["android-java","android-livedata","android-room"],"created_at":"2024-11-11T11:43:56.281Z","updated_at":"2026-06-10T18:31:40.821Z","avatar_url":"https://github.com/LeoAndo.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# overview\n\nJava + LiveDataを使ったRoomの技術調査用アプリ\n\n# スレッドセーフなsingleton instanceの扱いについて\n[document](https://developer.android.com/training/data-storage/room?hl=ja#database)やroomの内部実装を見ると、RoomDatabaseやdaoをシングルトンで扱うことを推奨している。\u003cbr\u003e\nhttps://github.com/LeoAndo/RoomJavaSample/blob/main/app/src/main/java/com/leoleo/roomjavasample/roomjavasample/data/DataModule.java\u003cbr\u003e\nこちらの実装はroomの自動生成ファイル(java)やjetpack、kotlinの遅延初期化(lazy)の内部実装を参考にした。\u003cbr\u003e\n\n### jetpackの内部コード datastore(kotlin)\nhttps://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:datastore/datastore-rxjava3/src/main/java/androidx/datastore/rxjava3/RxDataStoreDelegate.kt?hl=ja\n\u003cimg width=\"675\" alt=\"スクリーンショット 2023-07-13 23 53 34\" src=\"https://github.com/LeoAndo/RoomJavaSample/assets/16476224/b96b8bd5-86b1-4812-8368-a5405dc8364f\"\u003e\n\n### android roomの自動生成ファイル(java)\n\u003cimg width=\"786\" alt=\"スクリーンショット 2023-07-13 23 48 13\" src=\"https://github.com/LeoAndo/RoomJavaSample/assets/16476224/e8949d1c-f8fb-4463-96bd-2d27cae448ca\"\u003e\n\u003cimg width=\"714\" alt=\"スクリーンショット 2023-07-13 23 48 04\" src=\"https://github.com/LeoAndo/RoomJavaSample/assets/16476224/be3ed6f4-cac0-4fec-a977-d526408a7f89\"\u003e\n\n### kotlinの遅延初期化(lazy)\nhttps://github.com/JetBrains/kotlin/blob/master/libraries/stdlib/jvm/src/kotlin/util/LazyJVM.kt#L55:L87\u003cbr\u003e\n\u003cimg width=\"923\" alt=\"スクリーンショット 2023-07-14 23 02 49\" src=\"https://github.com/LeoAndo/RoomJavaSample/assets/16476224/a04ed1aa-db49-4d8b-aad7-4e3e65a1bc14\"\u003e\n\n\n# capture\n\n\u003cimg src=./1.png width=50%/\u003e\n\n# refs\n https://en.wikipedia.org/wiki/Double-checked_locking#Usage_in_Java\u003cbr\u003e\n https://en.wikipedia.org/wiki/Singleton_pattern\u003cbr\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleoando%2Froomjavasample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleoando%2Froomjavasample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleoando%2Froomjavasample/lists"}