You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "venkat bapanapalli (JIRA)" <ji...@apache.org> on 2009/01/08 22:26:59 UTC

[jira] Created: (OPENJPA-852) createNativeQuery Method with string as argument returning identical rows .

createNativeQuery  Method with string as argument returning identical rows .
----------------------------------------------------------------------------

                 Key: OPENJPA-852
                 URL: https://issues.apache.org/jira/browse/OPENJPA-852
             Project: OpenJPA
          Issue Type: Bug
    Affects Versions: 1.2.0
         Environment: j2ee5, oracle , unix , websphere
            Reporter: venkat bapanapalli
            Priority: Blocker


here is the query 

Query query = getEntityManager()
                    .createNativeQuery("SELECT MA_IDENTIFIER, MA_PTN_KY, PGM_ID, DOP_CD, MDP_SEL_IND, EML_SEQ_NR FROM ATMV2721_MA_DPF  WHERE (MA_IDENTIFIER = ?1 " +
                            " AND MA_PTN_KY = ?2 " +
                            " AND PGM_ID = ?3) ", "OrderResults");

this is the  sql result mapping specifed in the entity for the native query. 

@SqlResultSetMapping(name = "OrderResults", entities = { @EntityResult(entityClass = com.aa.selfservice.web.domain.account.EmailOptinVO.class, fields = {
	@FieldResult(name = "aAdvantageNumber", column = "MA_IDENTIFIER"),
	@FieldResult(name = "partitionKey", column = "MA_PTN_KY"),
	@FieldResult(name = "programId", column = "PGM_ID"),
	@FieldResult(name = "code", column = "DOP_CD"),
	@FieldResult(name = "indicatorString", column = "MDP_SEL_IND"),
	@FieldResult(name = "sequenceId", column = "EML_SEQ_NR")}) }).

The query.getResultList() should return 7 rows of different data instead its returning 7 rows of identical data.
I have tried createquery(" SQl") no luck .  
Can some one please help me!

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Created: (OPENJPA-852) createNativeQuery Method with string as argument returning identical rows .

Posted by Pinaki Poddar <pp...@apache.org>.
1. Post a reproducible test case.
   I tested with a simple case with identical mapping and the results are as
expected.

2. It is a good practice to open JIRA issue *only after* confirming via this
message post that an unexpected observation really points to a software
fault. Often an initially reported observation can be resolved by
configuration or oversight.




-- 
View this message in context: http://n2.nabble.com/-jira--Created%3A-%28OPENJPA-852%29-createNativeQuery--Method-with-string-as-argument-returning-identical-rows-.-tp2130244p2131253.html
Sent from the OpenJPA Developers mailing list archive at Nabble.com.


[jira] Commented: (OPENJPA-852) createNativeQuery Method with string as argument returning identical rows .

Posted by "Catalina Wei (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-852?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12667557#action_12667557 ] 

Catalina Wei commented on OPENJPA-852:
--------------------------------------

Venkat,
We need more information in order to help you...

Could you post the following info ?
1  java source code of entity class - com.aa.selfservice.web.domain.account.EmailOptinVO 
2. how do you call query.setParameter() 

> createNativeQuery  Method with string as argument returning identical rows .
> ----------------------------------------------------------------------------
>
>                 Key: OPENJPA-852
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-852
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 1.2.0
>         Environment: j2ee5, oracle , unix , websphere
>            Reporter: venkat bapanapalli
>            Priority: Blocker
>
> here is the query 
> Query query = getEntityManager()
>                     .createNativeQuery("SELECT MA_IDENTIFIER, MA_PTN_KY, PGM_ID, DOP_CD, MDP_SEL_IND, EML_SEQ_NR FROM ATMV2721_MA_DPF  WHERE (MA_IDENTIFIER = ?1 " +
>                             " AND MA_PTN_KY = ?2 " +
>                             " AND PGM_ID = ?3) ", "OrderResults");
> this is the  sql result mapping specifed in the entity for the native query. 
> @SqlResultSetMapping(name = "OrderResults", entities = { @EntityResult(entityClass = com.aa.selfservice.web.domain.account.EmailOptinVO.class, fields = {
> 	@FieldResult(name = "aAdvantageNumber", column = "MA_IDENTIFIER"),
> 	@FieldResult(name = "partitionKey", column = "MA_PTN_KY"),
> 	@FieldResult(name = "programId", column = "PGM_ID"),
> 	@FieldResult(name = "code", column = "DOP_CD"),
> 	@FieldResult(name = "indicatorString", column = "MDP_SEL_IND"),
> 	@FieldResult(name = "sequenceId", column = "EML_SEQ_NR")}) }).
> The query.getResultList() should return 7 rows of different data instead its returning 7 rows of identical data.
> I have tried createquery(" SQl") no luck .  
> Can some one please help me!

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.