Fernando Sproviero

Greenhorn
+ Follow
since Mar 10, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Fernando Sproviero

Hi, I ended creating a class that implements IDataProvider.
Inside this class I have some properties:
-Service (could also be a DAO)
-filter properties.
-methods:



And GenericDetachableModel:




When the GenericDataProvider class is constructed, I pass the service (or dao) and the filter params.
Hope this helps.

Hi,

I'm listing some objects in a page using Dataview, DataProvider and LoadableDetachableModel.
I'm planning to add a form filter with some input boxes and a Filter button.
I was thinking on modifying somehow the DataProvider, and also the dao.
However, I'm not sure what is the best approach to pass the parameters to the DataProvider. Should I use a model?
Please can you advice?

Thanks.
Hi,

I have a DataProvider that implements IDataProvider, and for example in the size method I need to call the service as follows:

public int size() {
return service.countAllByDomainObjectY(domainObjectY);
}

DomainObjectX contains a manytoone relationship with DomainObjectY.
So, this countAllByDomainObjectY internally searches by the domainObjectY's id and returns the count of DomainObjectX associated with that specific domainObjectY.

Now, in order to do this I would need to have domainObjectY as a property of the DataProvider which I think it is not good because it would be serialized.

Should I change the service to receive just the domainObjectY's id and only "save" this id as a property of the DataProvider?