This is a migrated thread and some comments may be shown as answers.

Creating Stored Proc.. via OA Fluent Mapping

6 Answers 96 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Shurland
Top achievements
Rank 1
Shurland asked on 04 Mar 2012, 02:40 PM
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

6 Answers, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 06 Mar 2012, 02:58 PM
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 >>
0
Shurland
Top achievements
Rank 1
answered on 06 Mar 2012, 09:18 PM
Alexander, 

Is this feature foreseen for future editions
0
Alexander
Telerik team
answered on 07 Mar 2012, 05:39 PM
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 >>
0
Shurland
Top achievements
Rank 1
answered on 14 Mar 2012, 11:56 AM
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. 

0
Accepted
Alexander
Telerik team
answered on 16 Mar 2012, 03:21 PM
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 >>
0
Shurland
Top achievements
Rank 1
answered on 17 Mar 2012, 04:44 AM
Thanks Alexander, that totally worked. Thumbs up!!
Tags
General Discussions
Asked by
Shurland
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Shurland
Top achievements
Rank 1
Share this question
or