Profesor profesor=new Profesor(9, "Rosa", "Díaz", "Del Toro"); List correosElectronicos=new ArrayList<>(); correosElectronicos.add(new CorreoElectronico(3, "rosa@yahoo.com",profesor)); correosElectronicos.add(new CorreoElectronico(2, "rosa@hotmail.com",profesor)); correosElectronicos.add(new CorreoElectronico(1, "rosa@gmail.com",profesor)); profesor.setCorreosElectronicos(correosElectronicos); Session session=sessionFactory.openSession(); session.beginTransaction(); session.save(profesor); session.getTransaction().commit(); session.close();