{"id":29690740,"url":"https://github.com/daejoon/custom-repository","last_synced_at":"2025-07-23T06:37:47.951Z","repository":{"id":229607736,"uuid":"777042838","full_name":"daejoon/custom-repository","owner":"daejoon","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-08T06:04:32.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-09-09T06:52:34.012Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daejoon.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":"2024-03-25T04:33:03.000Z","updated_at":"2024-09-08T06:04:35.000Z","dependencies_parsed_at":"2025-03-30T13:00:14.532Z","dependency_job_id":null,"html_url":"https://github.com/daejoon/custom-repository","commit_stats":null,"previous_names":["daejoon/custom-repository"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/daejoon/custom-repository","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daejoon%2Fcustom-repository","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daejoon%2Fcustom-repository/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daejoon%2Fcustom-repository/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daejoon%2Fcustom-repository/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daejoon","download_url":"https://codeload.github.com/daejoon/custom-repository/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daejoon%2Fcustom-repository/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266631707,"owners_count":23959422,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":[],"created_at":"2025-07-23T06:37:45.174Z","updated_at":"2025-07-23T06:37:47.936Z","avatar_url":"https://github.com/daejoon.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Custom Repository\n\nhttps://docs.spring.io/spring-data/jpa/reference/repositories/custom-implementations.html\n\nSpring Data JPA와 Custom Repository를 Fragment 형식으로 복합적으로 사용할수 있다.\n관습적으로 Custom Repository에 @Component, @Repository를 붙이는데 Bean을 선언하지 않아도\nSpring Boot에서 Bean으로 등록해준다.\n\n```java\nclass RepositoryBeanDefinitionBuilder {\n...\n\n    private void potentiallyRegisterFragmentImplementation(RepositoryConfiguration\u003c?\u003e repositoryConfiguration,\n                                                           RepositoryFragmentConfiguration fragmentConfiguration) {\n\n        String beanName = fragmentConfiguration.getImplementationBeanName();\n\n        // Already a bean configured?\n        if (registry.containsBeanDefinition(beanName)) {\n\n            if (logger.isDebugEnabled()) {\n                logger.debug(String.format(\"Repository fragment implementation already registered: %s\", beanName));\n            }\n\n            return;\n        }\n\n        fragmentConfiguration.getBeanDefinition().ifPresent(bd -\u003e {\n\n            if (logger.isDebugEnabled()) {\n                logger.debug(String.format(\"Registering repository fragment implementation: %s %s\", beanName,\n                                           fragmentConfiguration.getClassName()));\n            }\n\n            bd.setSource(repositoryConfiguration.getSource());\n            registry.registerBeanDefinition(beanName, bd);\n        });\n    }\n...\n}\n```\n\n## Custom Repository\n\n* @Repository @Component를 붙이지 않아도 자동으로 Bean로 생성된다.\n* 명시적으로 빈으로 선언하면 중복되지 않고 선언되는 형식으로(이름 변경 가능) 빈이 생성된다.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaejoon%2Fcustom-repository","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaejoon%2Fcustom-repository","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaejoon%2Fcustom-repository/lists"}