I would like to retrieve all groups (Business and Consumer) and display them into a listGrid, but i have a problem.
I have :
- Super class CustomerGroup (annoted with @MappedSuperclass so i don't have any table into the database)
- BusinessGroup extends CustomerGroup
- ConsumerGroup extends CustomerGroup
I am able to display all BusinessGroup or ConsumerGroup but i have not found how to retrieve both.
My GroupListDataSourceFactory :
Code: Select all
public void createDataSource(String name, OperationTypes operationTypes, Object[] additionalItems, AsyncCallback<DataSource> cb) {
if (dataSource == null) {
operationTypes = new OperationTypes(OperationType.BASIC, OperationType.BASIC, OperationType.BASIC, OperationType.BASIC, OperationType.BASIC);
PersistencePerspective persistencePerspective = new PersistencePerspective(operationTypes, new String[]{}, new ForeignKey[]{});
DataSourceModule[] modules = new DataSourceModule[]{
//Here BusinessGroup
new BasicClientEntityModule("my.company.profile.domain.BusinessGroup", persistencePerspective, AppServices.DYNAMIC_ENTITY)
};
dataSource = new ListGridDataSource(name, persistencePerspective, AppServices.DYNAMIC_ENTITY, modules);
dataSource.buildFields(null, false, cb);
} else {
if (cb != null) {
cb.onSuccess(dataSource);
}
}
}
if i add a new BasicClientEntityModule for ConsumerGroup :
Code: Select all
DataSourceModule[] modules = new DataSourceModule[]{
//Here BusinessGroup
new BasicClientEntityModule("my.company.profile.domain.BusinessGroup", persistencePerspective, AppServices.DYNAMIC_ENTITY),
//Here ConsumerGroup
new BasicClientEntityModule("my.company.profile.domain.ConsumerGroup", persistencePerspective, AppServices.DYNAMIC_ENTITY)
};
it doesn't work.
Or if I use the super class :
Code: Select all
DataSourceModule[] modules = new DataSourceModule[]{
new BasicClientEntityModule("my.company.profile.domain.CustomerGroup", persistencePerspective, AppServices.DYNAMIC_ENTITY)
};
error :
Code: Select all
[ WARN] BaseHibernateCriteriaDao - rowCount projection for the given criteria did not result a single integer value, returning zero - did you add unnecessary paging constraints to the criteria?
Can you help me please?