Spring execute method after hibernate lazy loading -


i using spring boot 1.3.1 including spring data jpa. i'd execute method after lazy loading translations on loaded object.

example:

@entity @table(name = "commune") public class commune extends communebase { }  @mappedsuperclass public abstract class communebase {     private region region; }  @entity @table(name = "region") public class region extends regionbase { }  @mappedsuperclass public abstract class regionbase {     private string name; } 

testcode:

commune commune = communerepository.findone(communeid); region region = commune.getregion(); 

the result of getregion() should translated. tried aspect , following pointcut:

@afterreturning(pointcut="execution(* com.mycompany.application.data.domain.commune.getregion(..))", returning="returnvalue") 

the pointcut not called. other pointcuts in same project working expected.

any appreciated


Comments