Some questions about ORM

4 posts, 0 answers
  1. M Kumar
    M Kumar avatar
    40 posts
    Member since:
    Apr 2008

    Posted 06 Sep 2013 Link to this post

    hi

    i am now to open access ORM, i have few questions about open access orm

    1. can i add dynamically created table in open access orm dynamically, mean i add 5 tables in open access orm deploy in to customer place, if customer create 2 extra tables dynamically how to add these 2 tables to open access orm dynamically ?

    2. can i access data with dynamic table name i mean 
    Dim tablename = "Documents"
    Dim Doc = ctx.tablename
  2. Kristian Nikolov
    Admin
    Kristian Nikolov avatar
    206 posts

    Posted 09 Sep 2013 Link to this post

    Hello,

    You can dynamically add and access database tables by using Artificial Types, a feature of Telerik OpenAccess ORM which allows you to extend your model with persistent types defined at runtime. Note that in order to take advantage of Artificial Types you will have to use Fluent Mapping.

    Please refer to our Samples Kit where under the API node, you can find a sample called Consuming Types Defined During Runtime. It illustrates how to create, update and delete artificial types and their properties as well as how to create, read, update and delete artificial entities.

    Regards,
    Kristian Nikolov
    Telerik
    OpenAccess ORM Q2 2013 brings you a more powerful code generation and a unique Bulk Operations support with LINQ syntax. Check out the list of new functionality and improvements shipped with this release.
  3. DevCraft banner
  4. M Kumar
    M Kumar avatar
    40 posts
    Member since:
    Apr 2008

    Posted 17 Sep 2013 Link to this post

    Hi
    i didn't mean totally dynamic
    ok i can create new table with the help of simple sql query
    my question is
    1. can i access newly created sql server table via ORM

    how to query the newly created table
    Dim tablename = "Documents"
    Dim Doc = ctx.tablename


    how to combine query
    mean how to query this newly created table with previously created table with relationship

    i already told you i have no idea about table name and column names then how i going to create fluent mapping
    can you give simple example?

    if i can not achieve the required feature i think better i stop searching this ORM
  5. Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 18 Sep 2013 Link to this post

    Hello M Kumar,

    The Artificial types functionality that my colleague recommended is exactly what you need in this case. With artificial types you can create persistent classes dynamically and access their properties using an entirely string-based API.

    There is one requirement though, which is that your initial (non dynamic) model should also be defined using our fluent API. This is the easiest and most powerful way to extend the model later with artificial types. Please note that you could create your model using the Telerik OpenAccess Fluent Library template, which would generate the initial needed fluent code automatically from your database. Afterwards you need to add only the code for creating artificial types at runtime.

    For more information please have a look at the links provided in the previous post and feel free to contact us again if you face any difficulties.

    Regards,
    Alexander
    Telerik
    OpenAccess ORM Q2 2013 brings you a more powerful code generation and a unique Bulk Operations support with LINQ syntax. Check out the list of new functionality and improvements shipped with this release.
Back to Top