v8.3d_2012-11-06/PowerEdition Deployment (built 2012-11-06)
datasource
And ListGrid:
Problems:
1. Fetch operation is processed using all-fields sql(HQL)
while quick start guide says:
Maybe this is not a big problem until generated HQL contains extra joins which are totally unnecessary.
2. The second problem is that ListGrid still contains all the other columns from datasource (with outputs="lastName" - only one field). They are rendered but contain no data. I don't know, whether it works as designed... Should i manually setup fields in my java-code every time i'm using operationBinding or is it a bug?
TY
datasource
Code:
<DataSource ID="users" serverType="hibernate" beanClassName="ru.eurotechnologygroup.etgcrm.server.model.User" schemaBean="ru.eurotechnologygroup.etgcrm.server.model.User" allowAdvancedCriteria="true"> [b]<operationBindings> <operationBinding operationType="fetch" operationId="listFetch" outputs="lastName"/> </operationBindings>[/b] <fields> <field name="id" title="Идентификатор" required="true" detail="true" hidden="false"/> <field name="lastName" title="Фамилия" length="30" required="true"/> <field name="firstName" title="Имя" length="30"/> <field name="secondName" title="Отчество" length="30"/> <field name="departmentName" title="Подразделение" type="text" valueXPath="department/name"/> <field name="department" title="Подразделение" displayField="departmentName" hidden="true"/> <!--<field name="departmentName" includeFrom="departments.name" hidden="true"/> <field name="department" title="Подразделение" foreignKey="departments.id" displayField="departmentName"/>--> <field name="phone" title="Телефон" length="50"/> <field name="email" title="EMail" length="50"/> <field name="login" title="Логин" length="20" required="true"/> <field name="password" title="Пароль" hidden="true" length="20" required="true"/> <field name="maskip" title="IP-маска" length="100"/> <field name="datebirth" title="Дата рождения" dateFormatter="toEuropeanShortDate"/> <field name="blocked" title="Заблокирован"/> <field name="roles" title="Роли" detail="true"/> </fields> </DataSource>
Code:
ListGrid listGrid = new ListGrid(); listGrid.setDataSource(DataSource.get("users")); listGrid.setFetchOperation("listFetch"); listGrid.setAutoFetchData(true);
1. Fetch operation is processed using all-fields sql(HQL)
Code:
=== 2012-11-07 03:29:33,613 [l0-4] DEBUG RPCManager - Processing 1 requests. === 2012-11-07 03:29:33,627 [l0-4] DEBUG RPCManager - Request #1 (DSRequest) payload: { criteria:{ }, operationConfig:{ dataSource:"users", operationType:"fetch", textMatchStyle:"substring" }, startRow:0, endRow:75, componentId:"isc_ListGrid_0", appID:"builtinApplication", operation:"listFetch", oldValues:{ } } === 2012-11-07 03:29:33,627 [l0-4] INFO IDACall - Performing 1 operation(s) === 2012-11-07 03:29:33,628 [l0-4] DEBUG DeclarativeSecurity - Processing security checks for DataSource null, field null === 2012-11-07 03:29:33,628 [l0-4] DEBUG DeclarativeSecurity - DataSource users is not in the pre-checked list, processing... === 2012-11-07 03:29:33,633 [l0-4] DEBUG AppBase - [builtinApplication.listFetch] No userTypes defined, allowing anyone access to all operations for this application === 2012-11-07 03:29:33,634 [l0-4] DEBUG AppBase - [builtinApplication.listFetch] No public zero-argument method named '_listFetch' found, performing generic datasource operation === 2012-11-07 03:29:33,634 [l0-4] INFO HibernateDataSource - [builtinApplication.listFetch] Performing fetch operation with criteria: {} values: {} === 2012-11-07 03:29:33,639 [l0-4] DEBUG HibernateTransaction - [builtinApplication.listFetch] Started new transaction "1555285483" === 2012-11-07 03:29:33,639 [l0-4] INFO HibernateDataSource - [builtinApplication.listFetch] Query string: select _User, department1 from ru.eurotechnologygroup.etgcrm.server.model.User _User left outer join _User.department department1 === 2012-11-07 03:29:33,647 [l0-4] DEBUG SQL - select count(*) as col_0_0_ from suser user0_ === 2012-11-07 03:29:33,655 [l0-4] DEBUG SQL - select top 75 user0_.USERID as USERID0_0_, department1_.DID as DID2_1_, user0_.USERBLOCKED as USERBLOC2_0_0_, user0_.USERDATEBIRTH as USERDATE3_0_0_, user0_.DID as DID0_0_, user0_.USEREMAIL as USEREMAIL0_0_, user0_.USERFIRSNAME as USERFIRS5_0_0_, user0_.USERLASTNAME as USERLAST6_0_0_, user0_.USERLOGIN as USERLOGIN0_0_, user0_.USERMASKIP as USERMASKIP0_0_, user0_.USERPASSWORD as USERPASS9_0_0_, user0_.USERPHONE as USERPHONE0_0_, user0_.USERPATRONYMIC as USERPAT11_0_0_, department1_.DNAME as DNAME2_1_ from suser user0_ left outer join department department1_ on user0_.DID=department1_.DID === 2012-11-07 03:29:33,688 [l0-4] INFO DSResponse - [builtinApplication.listFetch] DSResponse: List with 75 items
With the built-in DataSources, it also limits the fields requested from the underlying data store.
2. The second problem is that ListGrid still contains all the other columns from datasource (with outputs="lastName" - only one field). They are rendered but contain no data. I don't know, whether it works as designed... Should i manually setup fields in my java-code every time i'm using operationBinding or is it a bug?
TY
Comment