Creating Stored Proc.. via OA Fluent Mapping

7 posts, 1 answers
  1. Shurland
    Shurland avatar
    9 posts
    Member since:
    Aug 2012

    Posted 04 Mar 2012 Link to this post

    How can i create and execute stored procedures using the fluent mapping api forward method. I can't find any documentation on this topic. Is this possible? I currently using OA ORM 2011 Q1 SP1
  2. Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 06 Mar 2012 Link to this post

    Hello Shurland,

    I am afraid that OpenAccess cannot be used for stored procedures generation. The only case when OpenAccess could generate a stored procedure is when a class is configured to use procedures for CUD operations instead of dynamic SQL queries, as described in this article.

    Kind regards,
    Alexander
    the Telerik team
    Telerik OpenAccess ORM Q1 2012 release is here! Check out what's new or download a free trial >>
  3. DevCraft banner
  4. Shurland
    Shurland avatar
    9 posts
    Member since:
    Aug 2012

    Posted 06 Mar 2012 Link to this post

    Alexander, 

    Is this feature foreseen for future editions
  5. Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 07 Mar 2012 Link to this post

    Hello Shurland,

    I am afraid that currently we have no plans to implement such a feature. Please excuse us for the inconvenience caused.

    Greetings,
    Alexander
    the Telerik team
    Telerik OpenAccess ORM Q1 2012 release is here! Check out what's new or download a free trial >>
  6. Shurland
    Shurland avatar
    9 posts
    Member since:
    Aug 2012

    Posted 14 Mar 2012 Link to this post

    Thanks! 

    I have another question. What version of ORM supports many-to-many mapping? I ask this because when i try a many... i keep getting an error. Here's what i'm trying to achieve.

    I have to classes, Product and ProductTag. They both have their respective tables in the database. Then there's a third table Product_ProductTag that maps to each table by the primary keys. 

    In the POCO classes there' navigation properties ProductTags of type IList on the products class, and Products of type IList on the ProductTag class. 

    so here's the code that i'm using to map these to the database using fluent mapping.

                catalogMapping.HasAssociation(Function(p As Product) p.ProductTags).WithOpposite( _
                    Function(t As ProductTag) t.Products).MapJoinTable("Product_ProductTag", _
                    Function(p As Product, t As ProductTag) New With {Key .ProductId = p.ProductId, Key .ProductTagId = t.ProductTagId}).IsManaged()

    But nothing after the "HasAssociation" declaration is recognized. The message i get is: Overload resolution failed because no accessible 'HasAssociation' is most specific for these arguments. 

  7. Answer
    Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 16 Mar 2012 Link to this post

    Hi Shurland,

    You could try specifying explicitly the generic parameter of the HasAssociation method like this:
    catalogMapping.HasAssociation(Of ProductTag)(Function(p As Product) p.ProductTags)...
    Hope that helps.

    Regards,
    Alexander
    the Telerik team
    Telerik OpenAccess ORM Q1 2012 release is here! Check out what's new or download a free trial >>
  8. Shurland
    Shurland avatar
    9 posts
    Member since:
    Aug 2012

    Posted 16 Mar 2012 Link to this post

    Thanks Alexander, that totally worked. Thumbs up!!
Back to Top
DevCraft banner