v8.3p_2012-11-22/PowerEdition Deployment (built 2012-11-22)
I have a multipicker of roles for user. It functions well during update of records, but there's a problem while filtering.
User.java
users.ds.xml
TY.
I have a multipicker of roles for user. It functions well during update of records, but there's a problem while filtering.
Code:
=== 2012-11-27 17:20:20,300 [l0-3] INFO HibernateDataSource - [builtinApplication.listFetch] Performing fetch operation with
criteria: [b]{criteria:[{fieldName:"roles",operator:"inSet",value:[{id:1}]}],operator:"and",_constructor:"AdvancedCriteria"}[/b] values: {criteria:[{fieldName:"roles",operator:"inSet",value:[{id:1}]}],operator:"and",_constructor:"AdvancedCriteria"}
=== 2012-11-27 17:20:20,304 [l0-3] DEBUG HibernateTransaction - [builtinApplication.listFetch] Started new transaction "879184403"
=== 2012-11-27 17:20:20,312 [l0-3] WARN HibernateDataSource - [builtinApplication.listFetch] [b]Failed to cast value for field 'roles' in criterion 'inSet'.
Value '{id=1}' of type 'class org.apache.commons.collections.map.LinkedMap' can not be cast to type 'interface java.util.List'.
Skipping value: '{id=1}'[/b]
=== 2012-11-27 17:20:20,312 [l0-3] INFO HibernateDataSource - [builtinApplication.listFetch] Query string: select _User, department1 from ru.eurotechnologygroup.etgcrm.server.model.User _User left outer join _User.department department1 where (1=2)
=== 2012-11-27 17:20:20,323 [l0-3] DEBUG SQL - select count(*) as col_0_0_ from suser user0_ where 1=2
=== 2012-11-27 17:20:20,331 [l0-3] INFO DSResponse - [builtinApplication.listFetch] DSResponse: List with 0 items
User.java
Code:
@Entity
@Table(name = "suser")
public class User implements Serializable
{
...
@ManyToMany(targetEntity = Role.class, fetch = FetchType.LAZY)
@JoinTable(name = "userrole", joinColumns = @JoinColumn(name = "UserID"),
inverseJoinColumns = @JoinColumn(name = "URID"))
public List<Role> getRoles()
{
return roles;
}
}
Code:
<DataSource ID="users" serverType="hibernate" beanClassName="ru.eurotechnologygroup.etgcrm.server.model.User"
schemaBean="ru.eurotechnologygroup.etgcrm.server.model.User" allowAdvancedCriteria="true">
<fields>
<field name="id" title="Идентификатор" 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="Подразделение" includeFrom="departments.name" canSave="false"/>
<field name="department" title="Подразделение" foreignKey="departments.id" displayField="departmentName"
hidden="true" editorType="IPickTreeItem" required="true" advancedFilterField="true"/>
<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" viewRequiresRole="R_ADM"/>
<field name="maskip" title="IP-маска" length="100"/>
<field name="datebirth" title="Дата рождения" dateFormatter="toEuropeanShortDate"/>
[b]<field name="roles" title="Роли" detail="true" customEditorType="RolesPicker" advancedFilterField="true"/>[/b]
<field name="blocked" title="Заблокирован"/>
</fields>
</DataSource>
Comment