public void removeEntity(int rowIndex) { GenericDao<Bid> bidDao = DaoManager.getInstance().getBidDao(); Good entity = (Good) items.get(rowIndex); for (Bid b : entity.getBids()) { bidDao.delete(b); } items.remove(rowIndex); fireTableDataChanged(); DAO.delete((T) entity); }
public void addEntity(T item) { DAO.create(item); fireTableDataChanged(); }
@Override public int getRowCount() { items = DAO.findAll(); return items.size(); }