[jboss-user] [JBoss Seam] - Re: SMPC - entityManager doesn`t get autocreated

w17chm4n do-not-reply at jboss.com
Wed Dec 5 06:10:33 EST 2007


Oh and questionCategoryManager code

  | @Stateful
  | @Scope(ScopeType.APPLICATION)
  | @Name("questionCategoryManager")
  | public class QuestionCategoryManagerBean implements QuestionCategoryManager {
  |     
  |     @Logger
  |     Log log;
  |     
  |     @In
  |     private EntityManager entityManager;
  | 
  |     public void addCategory(QuestionCategory category) {
  |         log.info("Persiting category ["+category.getCategoryName()+"]");
  |         category.setCreated(new Date());
  |         entityManager.persist(category);
  |     }
  | 
  |     public void removeCategory(QuestionCategory category) {
  |         log.info("Removing category ["+category.getCategoryName()+"]");
  |         entityManager.remove(category);
  |     }
  |     
  |     public List<QuestionCategory> getAllQuestionCategories() {
  |         log.info("Reciving QuestionCategory list");
  |         return entityManager.createQuery("from QuestionCategory qc order by qc.created").getResultList();
  |     }
  | 
  |     @Destroy @Remove
  |     public void destroy() {
  |     }
  | }

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4110473#4110473

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4110473



More information about the jboss-user mailing list