Hi Michael.<br><br>I donĀ“t know about your problem with the dvd store but i would like to give you a tip. <br>The Lazy loading works only with managed entities. That means that you have to get the entity with the entity manager and use it.
<br>If you have a reference that is persisted but is not attached to a entity manager you have to merge it.<br>For example.<br>If you have a Many to many relationship between an entity named Person and a entity named Project.
<br>@Entity<br>@Name(&quot;person&quot;)<br>public class Person implements Serializable {<br>&nbsp;&nbsp; //id and code<br>&nbsp; //...<br>&nbsp;<br>@ManyToMany<br>&nbsp;private List&lt;Project&gt; projects;<br><br>//getters and setters<br>}<br><br>
And have an action method that use a person object<br><br>public void doSopmething(){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //this.person is a valid reference to a person object in the session for example<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // you have to merge it so the entity manager can lazy load the projects.
<br><br>&nbsp;&nbsp;&nbsp;&nbsp; Person newReferenceToPerson = entityManager.merge(this.person);<br>&nbsp;&nbsp; //now, use the new object that is sincronized with the database.<br>&nbsp; // You could rereferenciate the person too.<br><br>&nbsp; List&lt;Project&gt; projects = 
newReferenceToPerson.getProjects();<br>&nbsp; //It lazy loads all projects asociated to this person.<br>&nbsp;&nbsp;&nbsp; <br>}<br><br>I hope this helps.<br><br><br><br><div><span class="gmail_quote">On 9/13/07, <b class="gmail_sendername">
ASavitsky</b> &lt;<a href="mailto:do-not-reply@jboss.com">do-not-reply@jboss.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Michel,<br><br>Try injecting your persistence context using @In - I believe that lazy loading only works with Seam-managed PC (the one injected via @PersistenceContext is not Seam-managed). Of course, you&#39;ll need to setup the SMPC properly as well... (look at examples)
<br><br>HTH,<br><br>Alex<br><br>View the original post : <a href="http://www.jboss.com/index.html?module=bb&amp;op=viewtopic&amp;p=4084001#4084001">http://www.jboss.com/index.html?module=bb&amp;op=viewtopic&amp;p=4084001#4084001
</a><br><br>Reply to the post : <a href="http://www.jboss.com/index.html?module=bb&amp;op=posting&amp;mode=reply&amp;p=4084001">http://www.jboss.com/index.html?module=bb&amp;op=posting&amp;mode=reply&amp;p=4084001</a><br>
_______________________________________________<br>jboss-user mailing list<br><a href="mailto:jboss-user@lists.jboss.org">jboss-user@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/jboss-user">https://lists.jboss.org/mailman/listinfo/jboss-user
</a><br></blockquote></div><br>