Sending more than one class

Hi guys,
In my application each table has a corresponding Serializable class javabeans style, fine-grained. If a table has a foreign key then it is refered to as a seperate class. For example:
CREATE TABLE location (location_id int, location_name varchar(50))
CREATE TABLE employee
(employee_id int, location_id int)
public class Location implements java.io.Serializable {
  int locationId;
  String locationName;
public class Employee implements java.io.Serializable {
  int employeeId;
  Location location;
}My DAOs retrieve data and populate the above class with it and then return it. The DAOs also resolved other classes references. So a DAO metohd getEmployeeById( int employeeId ) will return an Employee class object whose location is also being populated.
In a typical case, a JSP page request a Stateless Session Bean EJB which uses DAOs to retrieve data, put it in the corresponding class and then send it to JSP which process it and show it to user.
So basically these classes (are they called domain classes?) are being used to trasfer data so I can call them DTOs or VOs.
But some times I need to send a combination of classes data to JSP i.e., data comprised of more than one such class. What is the best way to manage this problem?
Thanks

Employee-Location was an example just to show how I am programming.
To show the problem I am having, here is a scenario:
I have 2 tables "task" and "job" for which I have created classes "Task" and "Job" respectively. Eash of these tables has foreign keys which are of no concern here (My DAOs when retrieve data do populate them properly).
public class Task implements java.io.Serializable {
  int taskId;
  String taskName;
public class Job implements java.io.Serializable {
  int jobId;
  String jobName;
}Now there is many-to-many relationship between these 2 tables and it is "taskjob" table (a foreign key to task table; another foreign key to job table). So I created a TaskJob class:
public class TaskJob implements java.io.Serializable {
  int taskJobId;
  Task task;
  Job job;
}In one JSP, user selects a Task and click OK. Then on the next page I need to list all Jobs defined in the System as checkboxes. The jobs which are linked to the Task selected will be shown as checked while other jobs will be shown as unchecked.
In this scenario the JSP needs data from both Job and TaskJob class. MY question is how to manage it cleanly?

Similar Messages

  • Sending more than one data to Socket

    Hi Guys
    How can i send more than one data to socket. What i have to do is
    in server side
    1) Want to send file data to socket
    2) and the name of the file to socket
    in client
    1) read the file data from socket
    2) read the file name from the socket
    3) and save the file.
    how can i do this, I know how to send only file data, but i am finding dificuilt to send both.
    please some one help me with sample code.
    Thanks in advance
    Shan

    Thanks for the reply
    the problem i am facing is send the file name and data together . I have modified a code to send the file data, giving the static file name at the client side. Could you please help me to modify the code to send both file name and data from server. I am pasting my code. Sorry to ask like this but i am struggling a lot in this issue. When you are free please help me.
    (Also i don't have any Duke dollers to assign for this post)
    import java.io.*;
    import java.net.*;
    class Server
    public static void main(String args[]) throws Exception
         try{
         String clientSentence;
         ServerSocket welcomeSocket = new ServerSocket(80);
         while(true)
              Socket connectionSocket = welcomeSocket.accept();
              BufferedReader inFromClient = new BufferedReader(new InputStreamReader(connectionSocket.getInputStream()));
              BufferedOutputStream outToClient = new BufferedOutputStream(connectionSocket.getOutputStream());
              System.out.println(inFromClient.readLine());
              int data;
              int totalSizeTransferred = 0;
              int totalSizeRead;
              int PACKET_SIZE = 20480;
              byte[] packet = new byte[PACKET_SIZE];
              System.out.println("reading file...");
              FileInputStream fis = new FileInputStream("36meg.pdf");
              while ((totalSizeRead = fis.read(packet, 0, packet.length)) >= 0)
                   outToClient.write(packet, 0, totalSizeRead);
                   totalSizeTransferred = totalSizeTransferred + totalSizeRead;
                   System.out.println(totalSizeTransferred);
         System.out.println("done reading file...");
         outToClient.close();
         fis.close();
         }catch(Exception ex){}
    import java.io.*;
    import java.net.*;
    class Client
         public static void main(String args[]) throws Exception
              String sentence;
              BufferedReader inFromUser = new BufferedReader(new InputStreamReader(System.in));
              Socket clientSocket = new Socket("194.129.252.65", 80);
              DataOutputStream outToServer = new DataOutputStream(clientSocket.getOutputStream());
              BufferedInputStream inFromServer = new BufferedInputStream(clientSocket.getInputStream());
              sentence = inFromUser.readLine();
              outToServer.writeBytes(sentence + '\n');
              FileOutputStream fos = new FileOutputStream("hello.jpg");
              int totalDataRead;
              int totalSizeWritten = 0;
              int DATA_SIZE = 20480;
              byte[] inData = new byte[DATA_SIZE];
              System.out.println("Begin");
         while ((totalDataRead = inFromServer.read(inData, 0, inData.length)) >= 0)
              fos.write(inData, 0, totalDataRead);
              totalSizeWritten = totalSizeWritten + totalDataRead;
              System.out.println(totalSizeWritten);
              System.out.println("Done");
              fos.close();
              clientSocket.close();

  • App that can send more than one attachment at a time....

    Does anyone know of a app that I can send more than one attachment at a time like resumes + cover letters. Not having any luck with gmail or pages for the Ipad.
    Please help

    The MPEG Streamclip app can batch process videos. It can even convert up to  4 videos at the same time.
    http://www.squared5.com/
    It's free...
    Just drop as many videos as you like into the batch window.

  • How can i send more than one signal to DMA FIFO?

    Hello,
    I'm trying to send more than one signal to DMA FIFO, but i don't know how to do. When i send one signal i don't have problems. I try to use one block DMA FIFO for one signal. For example if i have 3 signal i use · DMA FIFO but whe i want to wath them in a waveform chart the signals have a delay.
    How can I do to send more than one signal to DMA FIFO? and if that's no posible, How i can do for syncronizate the 3 signals?
    The data type of the signal is FXP <16,10>
    Regards.
    Pablo
    Solved!
    Go to Solution.
    Attachments:
    Block Diagram.jpg ‏81 KB
    Block Diagram.jpg ‏81 KB

    Not quite.  You need to use the Integer To Fixed Point Cast to change from the integers to your FXP numbers.  You can then build them into a cluster to write to the Waveform Chart.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Combine and Decode FXP.png ‏14 KB

  • How can I send more than one document on an email

    how can I send more than one document on one email

    Thank you but I understand that form of attaching a document. However when I select a document then click 'Share' I have the option of sending the document by email as a word or pages document or pdf, what I want to know is can I use this procedure to send more than one document per email and if I can how?

  • How can I send more than one foto in a email

    How can I send more than one foto in a email?

    Or, to send up to 5 photos in one email, open the Photos app, go to the Album containing the photos, tap Select, tap up to 5 photos (a blue tick will appear on them), then tap the Share icon (square with arrow pointing up) and choose Mail.
    If you choose more than 5 photos this way, you won't get the Mail option.

  • Sending more than one photo at a time

    OK, fine, no MMS. We have to e-mail our pics to our friends.
    But is there any way on an iPhone 3G to send more than one photo attachment at a time? Sometimes I'd like to send two or three pixs to my friends of an event and that means two or three separate e-mails that have to be addressed.
    Can't I just tag or mark more tan a single photo and send the bunch?

    unfortunately, its 1 picture only

  • I'm using an iPhone 4. I used to be able to send more than one picture at a time to another iPhone. Now I get messages that it cannot be delivered.  What's going on?

    While on vacation in Canada in July I started having trouble sending more than one pix at a time to other users. I don't recall having this problem before. Is there a limit on the number of pictures you can send via text? I wonder if I messed up some settings while I was in Canada. I had things set so that I could not receive phone calls so I wouldn't get charged.  Could I have messed up text / multimedia settings as well?

        We want your phone working just as well now as it did before your trip, sngbrd9. Are you trying to send the pictures to other Apple users using iMessage or are they being sent through MMS/picture messaging? Are you able to send pictures one at a time to those same contacts without an error? Did you change any settings in your camera to have HDR now instead of a slightly lower resolution with a smaller file size? 
    JenniferH_VZW
    Follow us on Twitter www.twitter.com/vzwsupport

  • TS2755 Ever since I updated my iphone 4 to 5.1.1, I am not able to send more than one picture at a time in a text message. Does anyone know how to fix this?

    Ever since I updated my iphone 4 to 5.1.1, I am not able to send more than one picture at a time in a text message. Does anyone know how to fix this?

    Yes, I know the photos stored on the device... But which app are you accessing the photos with? Which app do you want to be able to highlight more than one pic at a time in?
    There are literally thosands of apps that access the iOS Photo Library - which one(s) are you using?

  • CAN ANDROID SEND MORE THAN ONE PICTURE IN A SINGLE TEXT

    Hello,
    Can anyone tell me if Android Razr M is capable of sending more than one picture in a single email and how to do it?  Example:  I have several pictures to send to one person and do not want to send them one at a time if I don't have to.  Thank you

    Some devices if you long press on the text screen have the ability to send more than one photo. However your owners manual usually has this information.
    You also may not be able to send these multiples due to size constraints. Email is much better for these photos. Which of course is also limited by your ISP to around 10 megabytes per send.
    Good Luck

  • How to send more than one parameter from FORM to REPORT?

    Dear all,
    i can send one parameter from FORM to REPORT. but when i send more than one parameter it gives error: frm 41214 unable to run report.
    here is the code i think the error is in the following line of procedure:
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no p_date_from='||v_date_from||'p_date_to='||v_date_to);
    where to place the parameters and is there any space is required?
    Thanks
    Muhammad Nadeem

    Dear Saeed Iqbal,
    thanks for you reply.
    dear i am using Form 10g run_product is not supported in this version.
    i am using RUN_REPORT_OBJECT.
    PROCEDURE rep_gl_ledger IS
    repid REPORT_OBJECT;
    v_rep VARCHAR2(100);
    rep_status VARCHAR2(50);
    v_date_from date;
    v_date_to date;
    v_detail_id_from varchar2(100);
    v_detail_id_to varchar2(100);
    v_voucher_type varchar2(100);
    --req_no char(17);
    BEGIN
    v_date_from :=      :ledger_para.p_date_from;
    v_date_to :=      :ledger_para.p_date_to;
    v_detail_id_from :=      :ledger_para.p_detail_id_from;
    v_detail_id_to :=      :ledger_para.p_detail_id_to;
    v_voucher_type :=      :ledger_para.p_voucher_type;
    repid := find_report_object('gl_ledger');
    --repid := find_report_object('REPORT80');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_EXECUTION_MODE,BATCH);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,CACHE);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'pdf');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,'rep_online_FRHome');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no p_date_from='||v_date_from||'p_date_to='||v_date_to);
    --SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no');
    v_rep := RUN_REPORT_OBJECT(repid);
    rep_status := REPORT_OBJECT_STATUS(v_rep);
    WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
    LOOP
    rep_status := report_object_status(v_rep);
    END LOOP;
    IF rep_status = 'FINISHED' THEN
    /* Display report in the browser */
    WEB.SHOW_DOCUMENT('http://'||:GLOBAL.G_IP||'/reports/rwservlet/getjobid'||substr(v_rep,instr(v_rep,'_',-1)+1)||'?','_blank');
    ELSE
         message('Error when running report');
    END IF;
    END;
    Regards:
    Muhammad Nadeem

  • More than one class in single java source file?

    Is there a way to define more than one class in single java source file?
    I get a duplicate class definition error for each extra class, but I am sure there is a way to handle this in JDeveloper.
    Anyone knows how ?

    Please post the question in jdeveloper forum at
    JDeveloper and ADF
    for quick response.
    Regards,
    Anupama
    http://otn.oracle.com/sample_code/content.html

  • Can we query more than one class in a call to .tmib

    Hi,
    i am creating a utility to monitor the applications at run time using mib.any
    body have an idea if we can query more than one class in one call to .tmib.
    thanks
    roopesh

    That would be an interesting enhancement, perhaps using Embedded FML to
    pack multiple MIB requests into one buffer.
    Product Management makes all decisions about major enhancements, and it
    is based on customer need, so that's where the requests should go.
         Scott Orshan
    roopesh wrote:
    >
    yes.
    i am trying to devlop a utility which can monitor
    applications at runtime.i wanted to make as less the
    no of calls to tmib as possible but one class does
    not give all the information so i need to query
    more than one.
    anyways thanks for the reply.
    "MS" <[email protected]> wrote:
    Hi,
    Are you trying to write a Tuxedo app health-check monitor utility.
    A tuxedo client can make different calls to .TMIB service for different
    classes.
    I don't think we can query more than one class in a single call.
    Are you looking for something else??/
    HTH
    regards
    MS

  • More than one class in applet

    i want to ask that if my applet have more than one class, are all classes loaded to client machine autometically or i have to do it by another way (if yes how) ?

    Put all the stuff into a single zip or preferably a single jar.

  • Sending more than one string from a server to a client in TCP/IP

    hi,
    i have two VIs where one is the server and the other the client in TCP/IP. I need to send more than 2 strings to the client at the same time.i have used the XML method but then by using XML i cant send any thing else to the client because of the byte sizes. so either i need a new way to send the strings or a new way to send more data. i have attached my VIs to this post if you need to take a look.
    thanks,
    Rambaldi.
    Attachments:
    ServerClient.zip ‏83 KB

    Well, after looking at the code it is very difficult to understand what you are trying to do. Not to be nasty or anything but your code is a mess. Did you know that in both VIs you have an infinite loop? The only way to exit your VIs is to use the Abort button. This is bad since it doesn't allow you to actually perform any type of cleanup. Your wiring is very difficult to follow. You should also avoid using local variables to pass data through your application. If you need to pass data between two parallel processes use queues, notifiers or an action engine. You can get rid of all of the sequence frames that you have. They aren't really doing anything for you and are unnecessary.
    As to your particular question I would have to assume that it is simply a result of bad coding that is preventing you from sending more than one string. You have logic in the second loop that appears to be impossible to get to since the conrol used to switch the case statement is placed on a hidden part of the front panel. Take a look at the TCP server example I posted in this thread. The example is on the second page of that thread.
    In order to help you I think you need to provide a good description of exactly what you want your server and client to do. You also need to do some code cleanup to make it readable and easier to follow.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

Maybe you are looking for