transaction.commit();
return ogm;
}
private Project createAndPersistProjectWithProjectGroup() {
Transaction transaction = session.beginTransaction();
Project validator = new Project();
validator.setId( "project-3" );
validator.setName( "Validator" );
session.persist( validator );
ProjectGroup hibernateProjects = new ProjectGroup();
hibernateProjects.setId( "project-group-1" );
hibernateProjects.setName( "Hibernate" );
session.persist( hibernateProjects );
validator.setProjectGroup( hibernateProjects );
hibernateProjects.getProjects().add( validator );
transaction.commit();
return validator;
}