• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Wicket DataProvider calling a Service/Dao that requires a domain object

Fernando Sproviero
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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?
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic