// Don't load list
return;
}
CayenneForm form = (CayenneForm) getForm();
DataContext dataContext = form.getDataContext();
try {
List list = null;
if (getSelectQuery() != null) {
SelectQuery query = getSelectQuery();
if (!query.getOrderings().isEmpty()) {
orderingApplied = true;
} else if (getOrdering() != null && !orderingApplied) {
query.addOrdering(getOrdering());
orderingApplied = true;
} else if (getOptionLabel() != null && !orderingApplied) {
query.addOrdering(getOptionLabel(), true);
orderingApplied = true;
}
list = dataContext.performQuery(query);
} else if (getNamedQuery() != null) {
list = dataContext.performQuery(getNamedQuery());
} else if (getQueryName() != null) {
list = dataContext.performQuery(getQueryName(), false);
} else {
Class doClass = form.getDataObjectClass();
String getterName = ClickUtils.toGetterName(getName());
Method method = doClass.getMethod(getterName);
Class propertyClass = method.getReturnType();
SelectQuery query = new SelectQuery(propertyClass);
if (getOrdering() != null && !orderingApplied) {
query.addOrdering(getOrdering());
orderingApplied = true;
} else if (getOptionLabel() != null && !orderingApplied) {
query.addOrdering(getOptionLabel(), true);
orderingApplied = true;
}
list = dataContext.performQuery(query);
}
if (isRequired() && getOptionList().isEmpty() || isOptional()) {
getOptionList().add(Option.EMPTY_OPTION);
}