public static void load(ArrayList list, boolean forceReload) throws SQLException, Exception { if (list.isEmpty() || forceReload == true) { list.clear(); ArrayList params = new ArrayList(); String sqry = "SELECT * FROM prenotazione_oggetto ORDER BY pog_prenotazione"; PrenotazioneOggetto model; for (RowSet rowSet = Query.select(sqry, params, JndiName.dbTakaloa); rowSet.next(); list.add(model)) { model = new PrenotazioneOggetto(); String id = rowSet.getString(1); PrenotazioneOggettoDto.load(model, JndiName.dbTakaloa, id); } } }
public static void load(PrenotazioneOggetto model, String id, boolean forceReload) throws SQLException, Exception { if (!model.getCodicePrenotazioneOggetto().matches(id) || forceReload == true) { PrenotazioneOggettoDto.load(model, JndiName.dbTakaloa, id); } }