mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-04 20:28:00 +08:00
More descriptive exception on absence of view in datasource
This commit is contained in:
parent
40b7e91135
commit
8429db3ab6
@ -96,11 +96,14 @@ public class PropertyDatasourceImpl<T extends Entity>
|
|||||||
|
|
||||||
public View getView() {
|
public View getView() {
|
||||||
if (view == null) {
|
if (view == null) {
|
||||||
ViewProperty property = masterDs.getView().getProperty(metaProperty.getName());
|
View masterView = masterDs.getView();
|
||||||
|
if (masterView == null)
|
||||||
|
throw new IllegalStateException("No view for datasource " + masterDs.getId());
|
||||||
|
ViewProperty property = masterView.getProperty(metaProperty.getName());
|
||||||
if (property == null)
|
if (property == null)
|
||||||
return null;
|
return null;
|
||||||
if (property.getView() == null)
|
if (property.getView() == null)
|
||||||
throw new IllegalStateException("Invalid view definition: " + masterDs.getView()
|
throw new IllegalStateException("Invalid view definition: " + masterView
|
||||||
+ ". Property '" + property + "' must have a view");
|
+ ". Property '" + property + "' must have a view");
|
||||||
view = metadata.getViewRepository().findView(getMetaClass(), property.getView().getName());
|
view = metadata.getViewRepository().findView(getMetaClass(), property.getView().getName());
|
||||||
//anonymous (nameless) view
|
//anonymous (nameless) view
|
||||||
|
Loading…
Reference in New Issue
Block a user