java - Fetch an object without its relationships/children using Hibernate/JPA -
i using hibernate/jpa , need fetch object without relationship/children how can that? questions not use lazy or eager strategy because in both case children attached object, initializate or not.
ex: have obj onetomany relationship b. want fetch list of without b attached it.
thanks
you can use dto pattern desirable in restfull services. sure have fields need , can use spring modelmapper convert entity dto.
http://www.baeldung.com/entity-to-and-from-dto-for-a-java-spring-application
..or implement builder (lombok) or populator/converter pattern
Comments
Post a Comment