dynamic query generation (adhoc queries)

Thread is closed for posting
2 posts, 0 answers
  1. Giannis Kyrias
    Giannis Kyrias avatar
    2 posts
    Member since:
    Feb 2010

    Posted 16 Jul 2010 Link to this post

    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

  2. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 22 Jul 2010 Link to this post

    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
Back to Top