[ 
https://issues.apache.org/jira/browse/OLINGO-479?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14220472#comment-14220472
 ] 

dhaval gupta commented on OLINGO-479:
-------------------------------------

Hi Michael,

Function import definition :

@EdmFunctionImport(name = "GetProductInfoForIsin", returnType = 
@ReturnType(type = Type.SIMPLE, isCollection = false),
    httpMethod = HttpMethod.GET)
public List<Issue> getProductInfoForIsin(
   @EdmFunctionImportParameter(name = "MarketCode", facets = 
@EdmFacets(nullable = false)) final String marketid,
   @EdmFunctionImportParameter(name = "AssetCode", facets = @EdmFacets(nullable 
= false)) final String assetcode) {


 Query q = em
       .createQuery("SELECT E1 from Issue E1 WHERE E1.marketCode= '"
           + marketid+ "' and E1.assetCode="+assetcode+"");
    List<Issue> list= (List<Issue>) q
        .getResultList();
    return list;
}

Thanks
Dhaval


> Function import bind variables  swapping
> ----------------------------------------
>
>                 Key: OLINGO-479
>                 URL: https://issues.apache.org/jira/browse/OLINGO-479
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata2-core, odata2-jpa
>    Affects Versions: V2 2.0.0
>            Reporter: dhaval gupta
>            Assignee: Michael Bolz
>
> Hi,
> When we pass 2 parameters to function import , the values of the bind 
> variables are swapped at runtime at the time of query generation.
> For ex :
> /Issues?AssetCode='FI'&TradeCntry='AU', then the query generated is 
> select  e from Issue e where e.assetCode ? and e.tradeCntry= ?
> bind values ['AU,'FI'] whereas it should have been reverse , it should be 
> bind values ['FI','AU'].
> Thanks
> Dhaval



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to