ItEr29S14ProcuraOrganizacionsTraballo: Lazy initialization of finder model
This commit is contained in:
parent
a148a56b34
commit
7f76428f73
1 changed files with 5 additions and 10 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue