If I have a repository:
public interface ThingRepository extends JpaRepository<Thing, UUID> {
@Query(/* query to get some Things */)
Collection<Thing> getSomeThings(/* some arguments */);
}
Which is autowired in by Spring/Hibernate, what state will the Thing
entity objects that are returned be in (persistent/detached/transient/etc)?
Context - if we make a change to a returned Thing
(E.G. thing.setThingString("stuff!")
), is there ever a situation where these changes will be persisted back to the database without explicitly calling thingRepository.save(thing);
?