DevelopmentException: property 'mastert$UDC.udckey' should have Entity type

Hi,
I created a pickerfield dynamically. I created a query and set the datasource to this picker field. It prompted an error:DevelopmentException: property ‘mastert$UDC.udckey’ should have Entity type.
Thank you.

PickerField field = (PickerField) componentsFactory.createComponent(PickerField.NAME);
            UDCTYPE udcType = ipdetail.getUdctype();
            if(udcType != null) {
                String udcTypeName = udcType.getTypename();
                uDCsDs.setQuery(
                        " select e from mastert$UDC e,mastert$UDCTYPE d where e.udctype = d.ID AND d.typename = '" + udcTypeName + "'");
                String query = uDCsDs.getQuery();
                field.setDatasource(uDCsDs,"udckey");
            }

udckey is a field of table mastert$UDC.
If I change the property to the entity name-UDC, it showed an error:IllegalArgumentException: Could not resolve property path ‘UDC’ in ‘mastert$UDC’

PickerField field = (PickerField) componentsFactory.createComponent(PickerField.NAME);
            UDCTYPE udcType = ipdetail.getUdctype();
            if(udcType != null) {
                String udcTypeName = udcType.getTypename();
                uDCsDs.setQuery(
                        " select e from mastert$UDC e,mastert$UDCTYPE d where e.udctype = d.ID AND d.typename = '" + udcTypeName + "'");
                String query = uDCsDs.getQuery();
                field.setDatasource(uDCsDs,"UDC");
            }

Hi,

Where are you going to use pickerField and what do you want to pick with it?
PickerField is used when the entity attribute refers to another entity, for example, like Order refers to a Customer. From your query, it’s hard to say what do you use pickerField for.
Please clarify your needs or, better, add a sample project where your problem can be reproduced.