• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Seam with DAO

 
fatih soylemez
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have a few questions that i hope you can answer.
I am developing a project with Seam JPA and Tomcat(i dont use ejb3).It is not a simple application that i will only use CRUD operations on database.
And i like to use DAO pattern which makes code more readable,reusable etc.

My first questions are,

is it not good/useless to use service and dao layer with Seam? (Service,ServiceImpl,DAO,HibernateDAO)

if i use DAOs , do i have to use EntityManager inside them?What happens if i use EntityManager what happens if i dont?

how can i inject Services/DAOs into the session? i was using Service,Repository annotations to declare them and Autowired
annotations to get them from the session while using Spring.is there any similar way?


For example i have the following code,

but when i call MenuCategoryDAO from an Action class with @In annotation,it comes null.
Do i have to make any other declarations in the components.xml or somewhere else?


Can someone give me example of implementing DAOs without using EntityManager and using them
into Action classes.


 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please use code tags only for code.
 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seam doesn't hold your hands, if you want to create DAOs then do, no harm is done.
I'm not Seam developer but AFAIR, you can inject EntityManager or Hibernate Session.
About injecting objects into scopes, did you tried @Out ?
Bijection is a fundamental corner stone in Seam.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic