Win a copy of Terraform in Action this week in the Cloud forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Problem in setting bean value

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am developing a project as Task Tracking System.One of the entities used in my project are Client and Task.So i build the form bean for Client and Task.
The Client form Bean consists:Client Id,ClientName.The Task form bean consists of TaskId,TaskName,Description,CreateDate,Status etc.The Relation between client and task is of one to many relation.Now i want to show the list of task with their client.For this i am taking an arraylist and from the database i am picking the resultset containing taskid,taskname,createdate,clientid,clientname.Now the problem is that how should i set the bean value and store that in ArrayList so that i can print all the information.How should i create the relation.The relation is one to many.should i build another bean which extend task and add some repeated attributes like clientid, clientname etc(from client).Please give me suggestion on my problem(what should i do).

Please give me the suggestion of how to solve the above problem.I will be very grateful to you.
 
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In your Client form bean have an ArrayList for holding Task form bean instances.
Once you get the resultset from the DB, create an ArrayList of the Client form bean where each form bean will contain a list of the associated tasks and also the particular Client's details.
 
mohsin sheikh
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply but i didn't get you.Can you explain it in more detail.
If possible,also give me some code related to my problem.Thanks in advance
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic