In this question committing the transaction that saves the instances of entity2 and entity3, which each hold a reference to an Entity1 (entity1) instance, results in two records of entity1 appearing in the database (Since the reference is saved when each of the instances are saved).
If I have 2 Spring Data Repositories - Entity2Repository and Entity3Repository and I do the following will that result in 2 instances of entity 1 being contained in the database:
Entity1 entity1 = new Entity1();
entity1.name = "Name1";
entity1.value = "Value1";
Entity2 entity2 = new Entity2();
entity2.name = "Name2";
entity2.value = "Value2";
entity2.setEntity1(entity1);
Entity3 entity3 = new Entity3();
entity3.name = "Name3";
entity3.value = "Value3";
entity3.setEntity1(entity1);
Entity2Repository.save(entity2);
Entity3Repository.save(entity3);