Listas individuais

Olá pessoal, depois de muito tentar resolvi jogar esse problema pra vc´s, :D.
Tenho uma classe Pedido e nele há um arraylist com os itens deste pedido. Então eu crio um frame onde 2 variaveis do tipo Pedido são alimentadas, a primeira pedido eu vou auterar e a segunda deve ser meu arquivo original, ou seja, eu recebo 1 pedido, 1 para manipular e o outro (pedidoOriginal) pra quando for a hora de inserir e remover eu saber o que deve ser mudado, e esta não deve ser auterada. so que sempre que eu insiro itens no arraylist variavel manipulável “pedido”, a outra fica identica. vou postar o codigo das classes para vc´s darem uma olhada e dizer o que eu to fazendo errado q ja estou sem paciencia.

Classe DAO para manipulação e persistencia dos dados

import java.sql.Connection;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;

import javax.swing.JOptionPane;

import br.com.xernobill.jdbc.ConnectionFactory;
import br.com.xernobill.modelo.ItemPedido;
import br.com.xernobill.modelo.Pedido;

public class PedidoDAO {
	private Connection connection;
	
	public PedidoDAO(){
		try {
			this.connection = ConnectionFactory.getConnection();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
		
	@SuppressWarnings({ "null", "static-access" })
	public void insertPedido(Pedido pedido){
		String sql = "insert into pedidos(cliente_id,situacao,data,dataentrega,datapagament,obs) values (?,?,?,?,?,?)";
		PreparedStatement stmt = null;
		
		try {
			stmt = connection.prepareStatement(sql,stmt.RETURN_GENERATED_KEYS);
			stmt.setInt(1, pedido.getClienteId());
			stmt.setInt(2, pedido.getSituacao());

			try{
				stmt.setDate(3, pedido.getDataCriacao());
			} catch (NullPointerException e) {
				stmt.setDate(3, null);
			}
			
			try{
				stmt.setDate(4, pedido.getDataEntrega());
			} catch (NullPointerException e) {
				stmt.setDate(4, null);
			}
			
			try{
				stmt.setDate(5, pedido.getDataPagamento());
			} catch (NullPointerException e) {
				stmt.setDate(5, null);
			}

			stmt.setString(6, pedido.getObs()==null?null:pedido.getObs());
			if(!pedido.getItensPedido().isEmpty()){
				stmt.execute();//testar essa chave gerada
				ResultSet rs = stmt.getGeneratedKeys();
				rs.next();
				
				ItemPedidoDAO dao = new ItemPedidoDAO();
				dao.insertItensPedido(rs.getInt(1),pedido.getItensPedido());
				System.out.println("Pedido ID:"+rs.getInt(1)+" inserido");
				
				stmt.close();
			}else{
				System.out.println("Pedido não criado pro falta de itens");
			}
			
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			JOptionPane.showMessageDialog(null,"Erro na criação do pedido!");
			try {
				connection.rollback();
			} catch (SQLException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
		}
		
		
	}
	
	public void alteraPedido(Pedido novo, Pedido velho){
		String sql = "update pedidos set cliente_id = ?, situacao = ?, data = ?, dataentrega = ?, datapagament = ?, obs = ? where id = ?";
		PreparedStatement stmt = null;
		try {
			stmt = connection.prepareStatement(sql);
			stmt.setInt(1, novo.getClienteId());
			stmt.setInt(2, novo.getSituacao());

			try{
				stmt.setDate(3, novo.getDataCriacao());
			} catch (NullPointerException e) {
				stmt.setDate(3, null);
			}
			
			try{
				stmt.setDate(4, novo.getDataEntrega());
			} catch (NullPointerException e) {
				stmt.setDate(4, null);
			}
			
			try{
				stmt.setDate(5, novo.getDataPagamento());
			} catch (NullPointerException e) {
				stmt.setDate(5, null);
			}

			stmt.setString(6, novo.getObs()==null?null:novo.getObs());
			
			stmt.setInt(7, novo.getId());
			
			if(!(novo.getItensPedido().isEmpty())){
				stmt.execute();//testar essa chave gerada
				
				ItemPedidoDAO dao = new ItemPedidoDAO();
				
				// Procura na matriz novo, itens não contidos na matriz velho para inclusão.
				for (ItemPedido itemN:novo.getItensPedido()){
					boolean confirma = true;
					for (ItemPedido itemV:velho.getItensPedido()){
						System.out.println("ItemN "+itemN.getProdutoId()+" = ItemV "+itemV.getProdutoId()); //verificando valores
						if(itemN.equals(itemV)){
							confirma = false;
						}
					}
					if(confirma)
						dao.insertItem(novo.getId(), itemN);
				}
				
				// Procura na matriz velho, itens não contidos na matriz nova para remoção.
				for (ItemPedido itemV:velho.getItensPedido()){
					boolean confirma = true;
					for (ItemPedido itemN:velho.getItensPedido()){
						if(itemV.equals(itemN))
							confirma = false;
					}
					if(confirma)
						dao.removeItem(itemV.getId());
				}
				
				System.out.println("Pedido ID:"+novo.getId()+" alterado");
				
				stmt.close();
			}else{
				System.out.println("Pedido não alterado pro falta de itens");
			}
			
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			JOptionPane.showMessageDialog(null,"Erro na criação do pedido!");
		}
		
		
	}
	
	
}

Edita Pedido

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.HeadlessException;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Date;
import java.text.DateFormat;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;

import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFormattedTextField;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.table.DefaultTableModel;
import javax.swing.text.MaskFormatter;

import br.com.xernobill.dao.ClienteDAO;
import br.com.xernobill.dao.PedidoDAO;
import br.com.xernobill.dao.ProdutoDAO;
import br.com.xernobill.frameUI.table.JTableItens;
import br.com.xernobill.modelo.Cliente;
import br.com.xernobill.modelo.ItemPedido;
import br.com.xernobill.modelo.Pedido;

public class EditaPedidoUI extends JFrame {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private JTextField tfClienteId = new JTextField(5);
	private JTextField tfClienteNome = new JTextField(25);
	private JCheckBox cbSituacao = new JCheckBox("Dar Baixa");
	private JLabel lbTotal = new JLabel("0,00");
	private JFormattedTextField tfDataEntrega = new JFormattedTextField();
	private JFormattedTextField tfDataPagamento = new JFormattedTextField();
	private JPanel panel1 =new JPanel();
	private JScrollPane scrPane = new JScrollPane();
	private JPanel panel2 =new JPanel();
	private JButton btPlus = new JButton("+");
	private JButton btMinus = new JButton("-");
	private JTableItens tabela = new JTableItens();
	private JButton btCliente = new JButton("?");
	private Pedido pedido = new Pedido();
	private Pedido pedidoOriginal = new Pedido();//essa variavel não deveria sofrer qualquer alteração
	
	public EditaPedidoUI(Pedido ped) throws HeadlessException, ParseException {
		super("Cadastro de Pedidos");
		this.setLayout(new BorderLayout());
		this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		this.setVisible(true);
		this.setResizable(false);
		this.setSize(450, 400);
		this.setLocation(250, 150);
		
		this.pedido = ped;
		this.pedidoOriginal = ped;
		this.montaPanel(this.pedido);
		this.montaScrollPane(this.pedido.getId());
		
		this.montaPanelButton();
		panel1.setPreferredSize(new Dimension(this.getWidth(),100));
		this.getContentPane().add(panel1,BorderLayout.NORTH);
		this.getContentPane().add(scrPane,BorderLayout.CENTER);
		this.getContentPane().add(panel2,BorderLayout.SOUTH);
	}
	
	private void montaPanel(Pedido p) throws ParseException{
		btPlus.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				addItem();			
			}
		});
		
		btMinus.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				removeItem();
				
			}
		});
		
		cbSituacao.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				// TODO Auto-generated method stub
				
			}
		});
		
		MaskFormatter maskData = new MaskFormatter("##/##/####");
		tfDataEntrega = new JFormattedTextField(maskData);
		tfDataEntrega.setColumns(6);
		
		tfDataPagamento= new JFormattedTextField(maskData);
		tfDataPagamento.setColumns(6);
		tfDataPagamento.setEnabled(false);
		
		panel1.add(new JLabel("Cliente:"));
		tfClienteId.setText(Integer.toString(p.getClienteId()));
		panel1.add(tfClienteId);
		btCliente.setEnabled(false);
		panel1.add(btCliente);
		ClienteDAO cliDao = new ClienteDAO();
		tfClienteNome.setText(cliDao.getCliente(p.getClienteId()).getNome());
		panel1.add(tfClienteNome);
		panel1.add(new JLabel("Data Entrega:"));
		tfDataEntrega.setText(dateToString(p.getDataEntrega()));
		panel1.add(tfDataEntrega);
		if(p.getSituacao()==2){
			cbSituacao.setSelected(true);
			cbSituacao.setEnabled(false);
		}else{
			cbSituacao.setSelected(false);
		}
		panel1.add(cbSituacao);
		panel1.add(new JLabel("Data Pagamento:"));
		tfDataPagamento.setText(dateToString(p.getDataPagamento()));
		panel1.add(tfDataPagamento);
		if(p.getSituacao()== 2){
			btPlus.setEnabled(false);
			btMinus.setEnabled(false);
		}
		panel1.add(btPlus);
		panel1.add(btMinus);
		panel1.add(new JLabel("TOTAL:"));
		lbTotal.setText(doubleToMoney(p.getTotal()));
		panel1.add(lbTotal);
	}
	
	private void montaScrollPane(int pedidoId){
		tabela = new JTableItens(pedidoId);
		scrPane = new JScrollPane(tabela);
		scrPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
		
	}
	
	private void montaPanelButton(){
		tfClienteId.setEnabled(false);
		tfClienteNome.setEnabled(false);
		
		cbSituacao.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				if(cbSituacao.isSelected()){
					tfDataPagamento.setEnabled(true);
				}else{
					tfDataPagamento.setEnabled(false);
				}
				
			}
		});
		
		btCliente.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				SelecionaClienteUI dialog = new SelecionaClienteUI();
				dialog.setVisible(true);
				
				if (dialog.ok()){
					Cliente cliente = dialog.getClienteSelecionado();
					tfClienteId.setText(Integer.toString(cliente.getId()));
					tfClienteNome.setText(cliente.getNome());
					tfDataEntrega.requestFocus();
				}
			}
		});
		
		JButton btConfirma = new JButton("Confirma");
		btConfirma.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				PedidoDAO pDao = new PedidoDAO();
				int clienteId = Integer.parseInt(tfClienteId.getText());
				Date dataCriacao = new Date(new java.util.Date().getTime());
				pedido = new Pedido(pedido.getId(),clienteId, dataCriacao, pedido.getItensPedido());
				
				DateFormat formato = new SimpleDateFormat("dd/MM/yyyy");
				Date dataEntrega = null;
				try {
					dataEntrega = new Date(formato.parse(tfDataEntrega.getText()).getTime());
				} catch (ParseException e1) {
					// TODO Auto-generated catch block
					e1.printStackTrace();
				}
				
				pedido.setDataEntrega(dataEntrega);
				
				Date dataPagamento = null;
				if (cbSituacao.isSelected()){
					pedido.setSituacao(2);
					try {
						dataPagamento = new Date(formato.parse(tfDataPagamento.getText()).getTime());
					} catch (ParseException e1) {
						// TODO Auto-generated catch block
						e1.printStackTrace();
						dataPagamento = new Date(new java.util.Date().getTime());
					}
					pedido.setDataPagamento(dataPagamento);
				}else{
					pedido.setSituacao(1);
				}
				pDao.alteraPedido(pedido,pedidoOriginal);
				dispose();
				
			}
		});
		panel2.add(btConfirma);
		
		JButton btCancela = new JButton("Cancela");
		btCancela.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				dispose();				
			}
		});
		panel2.add(btCancela);
		
	}
	
	private void removeItem(){
		int opcao = JOptionPane.showConfirmDialog(null, "Remove este item?"); 
		if (opcao == JOptionPane.YES_OPTION){
			DefaultTableModel modelo = (DefaultTableModel)tabela.getModel();
			modelo.removeRow(tabela.getSelectedRow());
			tabela.setModel(modelo);
			tabela.getColumnModel().getColumn(1).setPreferredWidth(200);
			pedido.getItensPedido().remove(tabela.getSelectedRow()+1);
			lbTotal.setText(doubleToMoney(pedido.getTotal()));
			
		}
	}
	
	private void addItem(){
		CadastroItemPedidoUI dialog = new CadastroItemPedidoUI();
		dialog.setVisible(true);
		if (dialog.ok()){
			//modelo.addRow(new String[]{});
			DefaultTableModel modelo = (DefaultTableModel)tabela.getModel();
			ProdutoDAO prod = new ProdutoDAO();
			ItemPedido p = dialog.getItemPedido();
			modelo.addRow(new String[]{Integer.toString(p.getProdutoId()),prod.getProduto(p.getProdutoId()).getNome(),doubleToMoney(p.getValor()),prod.getProduto(p.getProdutoId()).getUnidade(),Double.toString(p.getQuantidade()),doubleToMoney(p.getDesconto()),doubleToMoney(p.getTotal())});
			
			tabela.setModel(modelo);
			tabela.getColumnModel().getColumn(1).setPreferredWidth(200);
			pedido.getItensPedido().add(dialog.getItemPedido());
			lbTotal.setText(doubleToMoney(pedido.getTotal()));
		}
		
	}
	
	private static String doubleToMoney(double valor){
		DecimalFormat df = new DecimalFormat("R$ ### ### ##0.00");
		return df.format(valor);
	}
	
	private String dateToString(final Date data){
		String d = null;
		try {
			SimpleDateFormat formatter= new SimpleDateFormat("dd/MM/yyyy");
			d = formatter.format(data);
		} catch (final NullPointerException e) {
			// TODO: handle exception
		}
		
		return d;
	}

}

Abraços, beijos e boa sorte!

Alguem se prontifica a me dizer onde está o problema?