3 Replies Latest reply on Sep 4, 2008 10:23 AM by nickarls

    NEWBIE: Seam-Project using DAOs instead of org.jboss.seam.framework.Query?

    mean.meanmachine.gmx.at

      Hello,


      I'm a student and I'm quiet new in working with seam. Before I started the webproject for my studies, I created a database (Postgres), entities (with NamedQueries), a middle-tier(?) and some DAO (Hibernate) classes with which I fill my entities.


      Now I created a new seam project, using the official seam introduction, and build the entities, etc. by using my existing database.


      After the project was built and worked so far, I copied the entities I've built in the first step over the generated one and now, I want to use my DAOs instead of the org.jboss.seam.framework.jar, that fetches the SQL-statements out of the xyzList-classes (e.g. AdresseList) by calling the method getEjbql().


      Hopefully you understood, what I mean and you can help me.


      I would be very happy if you could help me - of course, I also could upload my project, so that you can see its structure, etc.


      Please answer in a simple way, because my english is not the best and I'm a newbie in Java/Seam.


      Thanks and best regards,


      Dirk

        • 1. Re: NEWBIE: Seam-Project using DAOs instead of org.jboss.seam.framework.Query?
          jeffreyhsu

          this is seam application framework.


          you can get detail information in Chapter 13. The Seam Application Framework of the reference.

          • 2. Re: NEWBIE: Seam-Project using DAOs instead of org.jboss.seam.framework.Query?
            mean.meanmachine.gmx.at
            Hi Jeffrey,

            thanks for your fast reply! I've already read this chapter of the seam framework.

            But the way they describe it is not the way I would like to go. I wanted to use a structure like that:

            - de.autohaus.benutzerverwaltung
                 Benutzerverwaltung.java  <- interface
                 BenutzerverwaltungImpl.java implements the interface (= application tier that calls the methods from the DAO-Classes).
            - de.autohaus.benutzerverwaltung.db
                 BenutzerverwaltungDAO.java <- interface
                 BenutzerverwaltungDAOImpl.java <- implements the interface and accessing the database (including functions like "findAllUsers(){..} findAllUsersByName() {..} findAdressesByCode() {..}...") as you can see all functions concerning the users/customers
                 Customer (=Entities)
                 Address
                 BankAccount
                 ...

            - de.autohaus.fahrzeugverwaltung (the same as above for the vehicles)
                Fahrzeugverwaltung.java
                FahrzeugverwaltungImpl.java
            - de.autohaus.fahrzeuverwaltung.db
                FahrzeuverwaltungDAO.java
                FahrzeuverwaltungDAOImpl.java
                Entities

            - de.autohaus.bestellverwaltung (the same for the ordering)
                Bestellverwaltung.java
                BestellverwaltungImpl.java
            - de.autohaus.bestellverwaltung.db
                BestellverwaltungDAO.java
                BestellverwaltungDAOImpl.java
                Entities

            That's the way I would like to solve it (with namedQueries in the entities), but the only way I found it is to write a XYZHome-Class and make a getter that returns a query. But this is not a 3-Tier Architecture (hopefully this is the right word in english) in my mind?!?!

            Hopefully someone can help me doing it the way I described above.

            Thanks and best regards,

            Dirk
            • 3. Re: NEWBIE: Seam-Project using DAOs instead of org.jboss.seam.framework.Query?
              nickarls

              Dear mr. Machine (or may I call you Mean)?


              I recommend you read the few first chapters of the manual, too.


              Good luck with your homework.









              Sorry. Couldn't help myself. I did try. Honest.