OA ORM - Firebird Stored Proc parameter problem

Thread is closed for posting
3 posts, 1 answers
  1. Peter Sari
    Peter Sari avatar
    3 posts
    Member since:
    Apr 2010

    Posted 13 Aug 2013 Link to this post


    We're in the planning phase of migrating our ERP into .NET, and we're considering Telerik's OA as our ORM solution.
    We have an existing Firebird database (2.5), and we use a LOT of stored procedures (4000+).

    As we made our test projects, we came into a serius problem, as currently the ORM generates code for a list type SP like this:

    public IEnumerable<LISTA_PARTNERTORZSResultSet01> LISTA_PARTNERTORZS(int? sZURES, int? aZINTEZOBE, int? aZPARTNERTIPUSBE, int? aZSTATUSZBE, string nEVBE, int? aZVAROSBE, ref int? aZPARTNER, ref string sZPARTNERNEV, ref string sZIRSZ, ref int? sZAZORSZAG, ref int? sZVAROS, ref string sZORSZAGNEV, ref string sZVAROSNEV, ref string sZCIM1, ref string sZCIM2, ref string aDOSZAM, ref string sZAMLASZAM, ref string pOPARTNERNEV, ref string pOIRSZ, ref string pORSZAGNEV, ref string pVAROSNEV, ref int? pOAZORSZAG, ref int? pOVAROS, ref string pOCIM1, ref string pOCIM2, ref string tEL, ref string fAX, ref string kONTAKTNEV, ref string eMAIL, ref int? tOROLT, ref int? aZINTEZO, ref string nEVINTEZO, ref int? gYARTO, ref int? aZPARTNERTIPUS, ref string pARTNERTIPUSNEV, ref string mOBILTEL, ref int? aZPENZNEM, ref string pENZNEMNEV, ref int? aZFIZETESIMOD, ref string fIZETESIMODNEV, ref int? fIZETESIHATARIDO, ref DateTime? dATUM, ref string mEGJEGYZES, ref double? kEDVEZMENY, ref int? hITELLIMIT, ref int? aZPARTNERCSOPORT, ref string nEVPARTNERCSOPORT, ref int? aZSTATUSZ, ref string sTATUSZ, ref int? aZNYELV, ref string nEVNYELV, ref int? aZAZPENZNEMVALLAL, ref string vATID, ref int? aZBANK, ref int? aZARFOLYAMTIPUS, ref string nEVBANK, ref string pENZNEMNEVVALLAL, ref string nEVARFOLYAMTIPUS, ref string nEVUTK, ref int? aZUTK, ref int? aZPARTNERCSALAD, ref int? aZPARTNERKATEGORIA, ref string pARTNERCSALAD, ref string pARTNERKATEGORIA, ref string jOGISZEMELY, ref int? aZPARTNERMASTER, ref string kULSOKOD1, ref string kULSOKOD2)

    The problem is with the REF parameters. We don't need them, we'd like if the generated method only would require the 6 inbound parameters.. 
    Do you have any idea on this?

    Thanks in advance,
  2. Answer
    Kaloyan Nikolov
    Kaloyan Nikolov avatar
    118 posts

    Posted 15 Aug 2013 Link to this post

    Hi Peter,

    If you want to invoke these stored procedures and you are interested in the returned list of entities but you don't care about the InOut parameters then I would suggest you to use method overload expecting only the IN parameters. The method should define local variables for the ref parameters and then you should call the originally generated domain method by passing them. 

    This method overload can be generated by Telerik OpenAccess ORM if you modify our T4 code generation templates. Here is an article describing the steps you need to perform in order to customize the templates. Most of the changes should go in the "DomainMethodsGenerator.ttinclude" file. You will see that we have object model abstracting the stored procedure and it's parameters. Each of the parameters is represented an instance of the class "CodeDomainMethodParameter". Probably its "Mode" property would be the most interesting for you because it holds the information if this is In, Out or InOut parameter in database terms. 

    I hope this helps. Please do not hesitate to get back to us if you have any further questions. 

    Kaloyan Nikolov
    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 improvementsshipped with this release.

  3. Peter Sari
    Peter Sari avatar
    3 posts
    Member since:
    Apr 2010

    Posted 23 Aug 2013 Link to this post

    Dear Kaloyan,

    thanks for your help!
    We've managed to modify the code generation templates, so it's working fine now.

    Thanks again,
Back to Top