How can I make Spring Data+EclipseLink generate correct SQL Server syntax? -
i using spring data jpa (v 1.6.0.release) , eclipselink (v 2.5.2-m1) access sql server database (microsoft jdbc v 4). repository interface declares method:
list<inboxitemdto> findbyownerignorecaseandpatientsstatusin(string owner, patientdemographicsstatus[] statuses) when called single value in statuses[] array, works correctly, 2 values fails
com.microsoft.sqlserver.jdbc.sqlserverexception: incorrect syntax near ','log shows following trace:
select t1.id, t1.created_timestamp, t1.filename, t1.owner uploaded_documents t1 left outer join patient_summaries t0 on (t0.uploaded_documents_id = t1.id) ((upper(t1.owner) = upper(?)) , (t0.status in ((?,?)))) order t1.created_timestamp desc bind => [clerk2, new, modified] the fact works single status, not more, seems imply ms jdbc driver won't bind multiple values in (?,?). know of way make driver behave in more standard-compliant way, or alternatively make spring/eclipselink work around problem?
edit: i've tried using hibernate instead of eclipselink. works ok , sql in log looks this. appears problem lies in way statement prepared or parameters bound, rather sql syntax.
select inboxitemd0_.id id1_7_, inboxitemd0_.created_timestamp created_2_7_, inboxitemd0_.filename filename3_7_, inboxitemd0_.owner owner4_7_ uploaded_documents inboxitemd0_ left outer join patient_summaries patients1_ on inboxitemd0_.id=patients1_.uploaded_documents_id upper(inboxitemd0_.owner)=upper(?) , ( patients1_.status in ( ? , ? ) ) order inboxitemd0_.created_timestamp desc
Comments
Post a Comment