I am using the JPA in my webapp and I can\'t figure out how to persist two new entities that relate to each other. Here an example:
You can persist one object and its child at a time. So I think this should work:
ProfilePicture profilePicture = new ProfilePicture("http://www.url.to/picture.jpg"); // create the picture object
Consumer consumer = new Consumer("John Doe"); // create the consumer object
consumer.setProfilePicture(profilePicture);
consumerFacade.create(consumer);