• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

What are three classes(xHome.java,xList.java,x.java)?

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
I am learning Seam now. I have some doubts.

  • What are3 classes like xHome.java, xList.java and x.java when we seam-generate entities?
  • Are these 3 classes mandatory to run a project?
  • When are page parameters invoked before the page is called or after the page is called?


  • regards
     
    Ranch Hand
    Posts: 75
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I believe the x.java that you refer to is your entity class. In hibernate terms this is the class that is linked directly to your database table. The xList.java class is a Query class which extends from EntityQuery which in turn extends from the Query class. They provide a lot of built-in functionalities like pagination and sorting. This frees the programmer from a lot of cumbersome and repetitive coding to implement these functionalities which are part of most enterprise applications. In JSF terms it works as a backing bean for the list page. The xHome.java class on the other hand manages the CRUD operations for a single managed entity from the list displayed to the user. In JSF terms it works as a backing bean for the edit/create pages. I believe you can think of it more like an EJB home.

    These three classes are not mandatory to run a project. You can use an entity class and manage it using an action class.

    The page parameters are injected into the seam component when a method in the component is invoked. They are also set back into the context once the method invocation is complete.

    I may be wrong. Authors, please correct me if I am.
     
    Thirupathi Neela
    Greenhorn
    Posts: 13
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thank you Ashok for your quick and elaborate response.


    The page parameters are injected into the seam component when a method in the component is invoked. They are also set back into the context once the method invocation is complete.



    Could you please explain it more elaborately?
    Are they invoked on any method call or on specific method?
    What is the life scope of a page parameter?

    Here I have a page created. I am unable to understand it properly.
    Could you throw some light on it?

     
    Ashok C. Mohan
    Ranch Hand
    Posts: 75
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Could you please explain it more elaborately?


    The page parameters are evaluated upon entering a page. The value is assigned as mapped by the value expression. In your example, the page parameter customerAccountId will set the customerAccountId in the customerAccountHome component. This assignment happens prior to the rendering of the page so that the customerAccountId can be accessed from customerAccountHome. One interesting thing is that this operation is not uni-directional. The value of customerAccountHome.customerAccountId is read by the page parameter. So it is both setting and getting the value of the value expression in that order.

    Are they invoked on any method call or on specific method?


    The page parameter expressions are evaluated for every s:link or s:button you use in your page. It sets the corresponding backing bean property on every method call to a seam component (unless you specifically avoid it by the annotation @ByPassInterceptors).
     
    It's just a flesh wound! Or a tiny ad:
    a bit of art, as a gift, that will fit in a stocking
    https://gardener-gift.com
    reply
      Bookmark Topic Watch Topic
    • New Topic