Bug 379990 - Issue with NativeQuery and setParameter: no space after ? and before EOL results into null value
Summary: Issue with NativeQuery and setParameter: no space after ? and before EOL resu...
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-18 11:22 EDT by Ivan Vasyliev CLA
Modified: 2022-06-09 10:30 EDT (History)
2 users (show)

See Also:


Attachments
test case for the issue (5.89 KB, application/zip)
2012-05-18 11:22 EDT, Ivan Vasyliev CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Vasyliev CLA 2012-05-18 11:22:57 EDT
Created attachment 215853 [details]
test case for the issue

I have native query:

SELECT *   
FROM TEST_TABLE                         
WHERE START_DATE > ?                     
   AND END_DATE < ?                       

Query query = entityManager.createNativeQuery(test_sql, TestEntity.class);
...
        query.setParameter(1, dateFrom, TemporalType.TIMESTAMP);
        query.setParameter(2, dateTo, TemporalType.TIMESTAMP);
...

If ".. START_DATE > ?<SPACE><EOL> ..." then all works fine
If ".. START_DATE > ?<NO SPACE><EOL> ..." then parameters are nulls

Info from log:

[5/17/12 13:43:11:052 EEST] 0000002b SystemOut     O [EL Fine]: 2012-05-17 13:43:11.052--ClientSession(1745119236)--Connection(62063539)--Thread(Thread[WebContainer : 0,5,main])--SELECT *
 FROM TEST_TABLE  WHERE START_DATE > ?    AND END_DATE < ?
        bind => [null, null]

Please see attached test-case
Comment 1 Tom Ware CLA 2012-07-04 08:17:15 EDT
Setting target and priority.  See the following page for the meanings of these fields:

http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines

Community: Please vote for this bug if it is important to you.  Votes are one of the main criteria we use to determine which bugs to fix next.
Comment 2 Eclipse Webmaster CLA 2022-06-09 10:30:16 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink