This is a migrated thread and some comments may be shown as answers.

dynamic query generation (adhoc queries)

1 Answer 130 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Giannis Kyrias
Top achievements
Rank 1
Giannis Kyrias asked on 16 Jul 2010, 02:31 PM
I have an application where end users create adhoc reports by defining their options through a wizard where
1) The user selects the table(s) he wants to query
2) defines the joins for these tables
3) defines the list of fields he requires
4) supplies the filter criteria for the records to return

and returns a list of records based on the above selections
The applications holds all the necessary metadata needed to perform the query (connection string, tables names etc) and creates the sql string to execute

My question is if i can replace my existing code to use open access for the entire process of ad hoc queries.
main concerns are :
1) Can i define in code the tables to use for the model
2) can i define the metadata in code (connection string, mappings etc)
3)  define the criteria for the where clause
4) define criteria for group by clause


Giannis

1 Answer, 1 is accepted

Sort by
0
PetarP
Telerik team
answered on 22 Jul 2010, 04:44 PM
Hi Giannis Kyrias,

 All the things that your project requires are doable with OpenAccess. For the search criteria you can either construct SQL dynamically or take advantage of the Dynamic LINQ library. As for the dynamic metadata construction you have two possible approaches. You can dynamically edit the xml being used in the Database.Get() method should you be using the old way of reverse mapping (an example can be found here) or you can take advantage of our metadata container if you are using the new Visual Designer. Additional information regarding the metadata container can be found in our chm help being distributed with the product installation under OpenAccess ORM Visual Designer > Feature Reference > OpenAccess Metadata > Overview.

Best wishes,
Petar
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Giannis Kyrias
Top achievements
Rank 1
Answers by
PetarP
Telerik team
Share this question
or