ItEr29S14ProcuraOrganizacionsTraballo: Lazy initialization of finder model

This commit is contained in:
Diego Pino Garcia 2009-10-13 10:23:30 +02:00 committed by Javier Moran Rua
parent a148a56b34
commit 7f76428f73

View file

@ -36,19 +36,14 @@ import org.zkoss.zul.SimpleListModel;
*/
public abstract class BandboxFinder implements IBandboxFinder {
ListModel model;
public BandboxFinder() {
initializeModel();
}
@Transactional(readOnly = true)
private void initializeModel() {
model = new SimpleListModel(getAll());
}
private ListModel model;
@Override
@Transactional(readOnly = true)
public ListModel getModel() {
if (model == null) {
model = new SimpleListModel(getAll());
}
return model;
}