@PostPersist
private void update(){
System.out.println("On game post persist");
winner.getStat().incrementTotalWins();
}
So, after insert single Player, Game and Score both event listener triggers and has output like this
On game post persist
On score post persist
Player(createdAt=2018-03-14, nickname=Anonymous,
stat=PlayerStat(totalScore=100, totalWins=1, totalGames=1), scores=null)
But when I try to read this user in seperate request, I got next output:
I added this code in Score entity, so I want to update PlayerStat entity every time I save Score entity.
and this code in Game entitiy
So, after insert single Player, Game and Score both event listener triggers and has output like this
But when I try to read this user in seperate request, I got next output:
So Game event listener update PlayerStat, but Score event listener doesn't