Copy to ClipboardCopied!Toggle word wrapToggle overflow
ブックマークからこのページに移動した場合、 <h:dataTable> で使用される #{blog.recentBlogEntries} データは要求されると Seam の blog というコンポーネントにより遅延して読み出されます(「プルされる」)。 この制御の流れは従来の動作ベースの Web フレームワーク Struts で使用されているものとは逆です 。
例1.34
@Name("blog")
@Scope(ScopeType.STATELESS)
@AutoCreate
public class BlogService
{
@In EntityManager entityManager;
@Unwrap
public Blog getBlog()
{
return (Blog) entityManager.createQuery("select distinct b from Blog b left join fetch b.blogEntries")
.setHint("org.hibernate.cacheable", true)
.getSingleResult();
}
}
@Name("blog")
@Scope(ScopeType.STATELESS)
@AutoCreate
public class BlogService
{
@In EntityManager entityManager;
@Unwrap
public Blog getBlog()
{
return (Blog) entityManager.createQuery("select distinct b from Blog b left join fetch b.blogEntries")
.setHint("org.hibernate.cacheable", true)
.getSingleResult();
}
}
Copy to ClipboardCopied!Toggle word wrapToggle overflow