It seems like one of the easy way to query using query service should be query using a "query name". If I know the name, I should be able to query service to run that particular query.
Looking at the IQuerySvc Interface, seems like there is no API that supports this functionality.
The scenario I am thinking is lets say that I have two queries one this query for all the people whose salrary is less than 50,000 per year, and another query for folks that live in Austin, TX (both of them does not take any criteria object). I can only pass query service the entity class and in this case it would be Customer Class but passing just the class name is not good enough and neither is passing the criteria since there is no criteria. I don't see any way of doing it other than the fact that I introduce a dummy API parameter to let query service know which query I want to run?
Am I missing something?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
No, you're not missing anything, but here's the thing-- if you're willing to pass in a "name" to identify which query to use, why wouldn't you be willing to pass some other "identifier" to specify which query?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well you are right that as such there is no difference in the cases you present. But to me the difference is when I am writing the query, it becomes an extra responsibility on the query writer to provide this variable where as far as name is concerned, each query to begin with has a name.
So to answer your question, passing in the name does not require any extra work on part of query writer where as passing in some other identifier does require query writer to provide this identifier in the API parameter.
I don't think it is as such any maintainance issue but just a matter of convenience.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It seems like one of the easy way to query using query service should be query using a "query name". If I know the name, I should be able to query service to run that particular query.
Looking at the IQuerySvc Interface, seems like there is no API that supports this functionality.
The scenario I am thinking is lets say that I have two queries one this query for all the people whose salrary is less than 50,000 per year, and another query for folks that live in Austin, TX (both of them does not take any criteria object). I can only pass query service the entity class and in this case it would be Customer Class but passing just the class name is not good enough and neither is passing the criteria since there is no criteria. I don't see any way of doing it other than the fact that I introduce a dummy API parameter to let query service know which query I want to run?
Am I missing something?
No, you're not missing anything, but here's the thing-- if you're willing to pass in a "name" to identify which query to use, why wouldn't you be willing to pass some other "identifier" to specify which query?
Well you are right that as such there is no difference in the cases you present. But to me the difference is when I am writing the query, it becomes an extra responsibility on the query writer to provide this variable where as far as name is concerned, each query to begin with has a name.
So to answer your question, passing in the name does not require any extra work on part of query writer where as passing in some other identifier does require query writer to provide this identifier in the API parameter.
I don't think it is as such any maintainance issue but just a matter of convenience.