{"repo":"Cosium/spring-data-jpa-entity-graph","free":true,"listed":false,"github":"https://github.com/Cosium/spring-data-jpa-entity-graph","clone":"git clone https://github.com/Cosium/spring-data-jpa-entity-graph.git","description":"Spring Data JPA extension allowing full dynamic usage of EntityGraph on repositories","language":"Java","stars":534,"topics":["jpa","spring-data-jpa","entity-graph","orm","spring-data"],"license":"MIT","category":"databases-storage","readme_excerpt":"Spring Data JPA EntityGraph Spring Data JPA only supports EntityGraph through annotations. Thus, for a repository method, you must select at most one EntityGraph before compilation. This prevents you from choosing the best EntityGraph considering the runtime context :broken heart: Spring Data JPA EntityGraph allows you to choose EntityGraph at runtime! This choice is elegantly made by passing EntityGraph , as an argument, to any Spring Data JPA repository method :heart eyes: Quick start 1. Select the correct version from the compatibility matrix 2. In addition to Spring Data JPA, add Spring Data JPA EntityGraph dependency : 3. Set the repository factory bean class to EntityGraphJpaRepositoryFactoryBean : Usage On custom repository methods If you want to define a custom repository method accepting an EntityGraph , just do it™. For example, given an entity having attribute named label of type String, you could declare and use a repository like this: On pre-defined repository methods Spring Data JPA EntityGraph provides repository interfaces extending Spring Data JPA. For each Spring Data JPA pre-defined method, the provided interfaces overload the method with EntityGraph as an additional argument. For example, Spring Data JPA CrudRepository defines method Optional findById(ID id) . This method is overloaded by Spring Data JPA EntityGraph EntityGraphCrudRepository as Optional findById(ID id, EntityGraph entityGraph) . To be able to use these overloaded methods, you must extend o","default_branch":null,"files":null,"tree":[],"storefront":"/r/Cosium","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Cosium/spring-data-jpa-entity-graph/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}