Just another site

Monthly Archives: October 2011

@Unwrap and components

public class BlogService

   @In(create=true)                                                                      (1)
   private EntityManager entityManager;

   @Unwrap                                                                               (2)
   public Blog getBlog()
      return (Blog) entityManager.createQuery("from Blog b left join fetch b.blogEntries")
            .setHint("org.hibernate.cacheable", true)


The @Unwrap annotation tells Seam to provide the return value of the method—the Blog—instead of the actual BlogService component to clients. This is the Seam manager component pattern.