How to integrate OpenAccess ORM to a existant project?

2 posts, 0 answers
  1. Allin
    Allin avatar
    33 posts
    Member since:
    Jun 2012

    Posted 21 Sep 2012 Link to this post

    I'm newbie with ORM and i want to know if it's possible to include OpenAcces ORM to a existing project with class and DB already created?

    My goal, replaced current DB operation with OpenAccces ORM to be able to switch simply between SQL Server and Oracle DB with same DAL implementation. It's possible with this tool? Do you have sample project to explain this or others links with procedure to resolve case like this.

    Thank you.
  2. Ivailo
    Ivailo avatar
    318 posts

    Posted 24 Sep 2012 Link to this post

    Hello Allin,

    It is possible to plug OpenAccess ORM in such scenario. There are at least two approaches to achieve that:

    1) In case your classes are rather simple (similar to the database entities), you can just create a Domain Model in a Database First manner, name the new classes properly in the designer either by naming rules or the Batch Operations dialog, and use the new classes instead. The old ones can be used as partial classes so that you won't have to move your business logic or any other additions.

    2) In case the model is complex or you don't like the idea of replacing it, try using the Fluent Mapping. You can create a FluentMetadataSource, and define the mapping based on your existing entities.

    I would recommend you to go with the Fluent Mapping, as we have recently released (in Q2 2012 SP2) some new features there allowing you to define your types in a generic way, so what you can switch your database more easily. You can find more details here. Without such definitions, changing the database would require some manual effort for applying the appropriate types.

    Unfortunately we do not have a sample for this yet but we will be creating one in the near future. We do have samples for using Fluent Mapping, you can download and install the OpenAccess SDK to take a look at them.

    Let us know if you have any other questions.

    the Telerik team
    Follow @OpenAccessORM Twitter channel to be the first one to get the latest updates on new releases, tips and tricks and sneak peeks at our product labs!
  3. DevCraft banner
Back to Top