More in this section

Forums / General Discussions / Using custom tables with OpenAccess

Using custom tables with OpenAccess

3 posts, 0 answered
  1. Roberto
    Roberto avatar
    146 posts
    Registered:
    08 Feb 2008
    14 Apr 2011
    Link to this post
    Hi,

    I am writing a custom module, and i am basing it on the Jobs-Intermediate module example from the SDK.  i want my implementation to work with custom tablesn in the sitefinity database, and not have the module auto generate them.  Is this possible taking the example as it is? if not, what is the best way to do this, or is it simply just a case of switching our openAccess with say LinqQ??

    Thanks,

    Rob

  2. Roberto
    Roberto avatar
    146 posts
    Registered:
    08 Feb 2008
    15 Apr 2011
    Link to this post
    can no one shed some light on this?
  3. Slavo
    Slavo avatar
    295 posts
    Registered:
    24 Sep 2012
    21 Apr 2011
    Link to this post
    Hi Roberto Modica,

    The OpenAccess ORM can map classes to database tables in two ways - forward and reverse. In Sitefinity, and the particular sample you are talking about, we use forward mapping. That just means that the database tables are generated by the ORM from the persistent classes.

    You can also generate the persistent classes from the database tables (still using OpenAccess and not LINQtoSQL). However, we don't have a sample for this, and you will have to write your custom OpenAccess provider and use the reverse mapping mechanism in OpenAccess. The issues I can foresee with this approach are when you inherit from Content, which uses forward mapping.

    We haven't tested this scenario with Sitefinity, but it should be achievable with some more custom code. Here is some documentation on how to use OpenAccess reverse mappings: http://www.telerik.com/help/openaccess-orm/openaccess-tasks-howto-reverse-mapping-wizard.html

    Best wishes,
    Slavo
    the Telerik team

3 posts, 0 answered