@Stateful
  | @Scope(ScopeType.APPLICATION)
  | @Name("questionTypeManager")
  | public class QuestionTypeManagerBean implements QuestionTypeManager {
  |     
  |     @Logger
  |     Log log;
  |     
  |     @In
  |     EntityManager entityManager;
  | 
  |     public void addQuestionType(String questionType) {
  |         entityManager.persist(new QuestionType(questionType));
  |         entityManager.flush();
  |         log.info("Successfuly persisted question type");
  |     }
  |     
  |     public QuestionType getQuestionTypeByName(String questionTypeName) {
  |         return (QuestionType)entityManager.createQuery("from QuestionType q 
where q.questionType = '" + questionTypeName + "'").getSingleResult();
  |     }
  | 
  |     public List<QuestionType> getAllQuestionTypes() {
  |         return entityManager.createQuery("from QuestionType 
qt").getResultList();
  |     }
  |     
  |     @Remove @Destroy
  |     public void destroy() {}
  |     
  | }

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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4111193
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to