Saving an object which contains arraylists in arraylists
<p>I have an object of type Restaurant called myRestaurant which contains EmployeesAList, MenuAList and OrdersAList, each of which storing instances of objects Employee, Menu_Item and Order. Each instance of Order stores integers, strings and an arraylist of integers. </p>

<p>When I save myRestaurant, every arraylist is saved except for the arraylist which is within the Orders class. </p>

<p>Any suggestions?</p>

<p>save method in Runner</p>

<pre><code> public boolean SaveToFile(Restaurant myrest)
{
    try
    {
        File outFile = new File("etrest.rest");  
        //creates object representing file

        FileOutputStream outFileStream = new FileOutputStream(outFile);
        //connection between program and file

        ObjectOutputStream outObjectStream = new ObjectOutputStream(outFileStream);
        //class which is used to pass objects which will be saved to file

        //Write serializable ArrayList to file
        outObjectStream.writeObject(myrest);        

        //output done, so close the stream
        outObjectStream.close();
        return true;
    }
    catch(IOException IOE)
    {
        System.out.println(IOE.toString()); //debug purpose
        return false;        
    }
}
</code></pre>

<p>method in Restaurant to add Order</p>

<p>ArrayList OrdersAList = new ArrayList();</p>

<pre><code>public void AddOrder(Order o)
{
    OrdersAList.add(o);
}
</code></pre>

<p>part of order class
ArrayList Menu_ItemsIDAList = new ArrayList();</p>

<pre><code>public Order()
{
    paid = false;
    WaiterNo = 0;
    TableNo = 0;
    item = 0;
}

public Order(boolean pd, int wN, int tN, int it)
{
    paid     = pd;
    WaiterNo = wN;
    TableNo  = tN;
    item     = it;
}

//MENU ITEMS ENTERED PER ORDER
public void AddMenu_ItemID(int item)
{
    Menu_ItemsIDAList.add(item);
}
</code></pre>

<p>when i create an instance of Order I create a loop to populate the Menu_ItemsIDAList</p>
