3

I´m reading about Hibernate and using Spring data. In one chapter I´ve read about the different of use get() and load(), supposedly in Hibernate load return a proxy placeHolder and only access to database in case that you access to the entity attribute. In my application many times I just need to return and entity to add as dependency to another entity and for that specific case add a proxy would be more than enough, but using Spring data repository I cannot find the get() or load() method, so I guess they dont implement the same feature as in Hibernate. Any idea if Spring data has that Hibernate´s features to have a proxy placeHolder?.

Regards.

paul
  • 12,873
  • 23
  • 91
  • 153
  • for sure you cannot find hibernate specific functions in `spring-data-jpa`, in this case, hibernate is only the implementation of JPA – Jaiwo99 Aug 18 '14 at 13:23
  • I know that Spring data is a implementation of JPA that´s why I´m asking if in Spring data exist something like this hibernate implementaiton. I think my ticket description it´s not clear enough. I will changed it – paul Aug 18 '14 at 14:34
  • 2
    Have you ever resolved it? I think it's actually getOne could do it? – TechCrap Dec 31 '16 at 03:59

1 Answers1

3

JpaRepository interface has two methods: First is getOne(id) which is an alternative of hibernate load, second is findById(id) which is an aternative of hibernate get method.

Rajdeep
  • 270
  • 2
  • 11