As the title says I want to create triggers to create records in other tables when data is added in the primary table. For example, when a user registers, I want records in user_friends with some default value.
Initially I thought to handle in the service layer like this.
repositoryA.save(entityA);
repositoryB.save(entityA);
But this method creates two different db sessions and I want to keep the number of sessions / calls to a minimum. Would also like to avoid native SQL or tweaking the db directly.