How to save changes to an Entity using JPA
<p>I have an Entity <code>User</code> and an Entity <code>UserPage</code>
The User does not have a UserPage when you create him<br>
Now I want to create a userpage and assign it to the user. This looks like this:</p>

<pre><code>UserPage page= new UserPage([Attributes here]);
User user; (this is a User previously created, persisted and now fetched)
</code></pre>

<p>now I do the following:  </p>

<pre><code>user.setUserPage(page);
userPageEJB.persist(page);
</code></pre>

<p>now when I want to fetch the userPage of the user, I do:</p>

<pre><code>User user= userEJB.getUserByID([userID here]);
UserPage page= user.getUserPage();
</code></pre>

<p>The problem now is, that the changes appear not to have been saved (the last line of code always returns null). How do I save them so I can fetch the page of a specific user?</p>