Skip to end of metadata
Go to start of metadata

Suppose to have a to one relationship, for example between the Movie and Director entities and a window to search Movies, showing for each movie the Director name and surname.

Can i declare in the service object that the finder method for the movie also load data for the director?

I need to obtain that using a single SQL, the framework load objects of type Movie and objects of type Director.


IFetchSpecification has a property called 'Spans' which can be set to a string array of query paths that should be fetched with the main entity. The following code snipped retrieves all movies that have a title starting with A and the corresponding directors.

This will actually result in two SQL statements, one to fetch the movies and a second one to get the corresponding directors. That's still much better than one statement to get the movies and then one statement per movie to get the directors. SQL Server may support non-rectangular result sets but I'm not sure whether that's worth the effort.

Note: This feature has been added for the 1.4 release. As this has not been released at the time of writing you have to work with the latest version from CVS.

Labels:
  1. Jul 29, 2005

    It is not planned an object query language to do this?

  2. Jul 29, 2005

    Can you ask that question on the user mailing list? Seems like a better way to discuss ideas. Thanks.