Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Batch fetch for type IN results in sql exception (Batch fetch for type IN on relationships with composite foreign keys results in sql exception)
Batch fetch for type IN results in sql exception [message #1015507] Thu, 28 February 2013 18:12 Go to previous message
Prasad Mysore is currently offline Prasad Mysore
Messages: 3
Registered: February 2013
Junior Member
DB: Microsoft SQL Server
Eclipselink version : 2.3.2
Springframework version: 3.0.6


I am working on optimizing some JPA object graph queries, and I am trying to evaluate all the three Batch fetch types. Join and Exists seem to work fine. When I tried IN batch fetch type, I found that the IN queries that are generated have sql syntax problems. This is because of our entity join mappings having composite foreign keys.

For eg. the sql that is generated looks like this.

SELECT schemaId, overlayGroup, archiveFromForm, archiveRelated, archiveToFile, archiveToForm, archiveType, associations, enable, hourmask, minute, monthday, numLevels, tagsLong, tagsShort, weekday, queryLong, queryShort FROM schema_archive WHERE ((schemaId, overlayGroup) IN ((?,?),(?,?),(?,?),(?,?),(?,?),(?,?),(?,?),(?,?),(?,?),(?,?),(?,?),(?,?),(?,?),(?,?),(?,?),(?,?),(?,?),(?,?),(?,?),(?,?),(?,?),(?,?),(?,?),(?,?),(?,?)))
bind => [50 parameters bound]


Our JoinMapping for the specific one-one mapping looks like this

@OneToOne(mappedBy = "form", fetch = FetchType.EAGER, targetEntity = ArchiveEntity.class, cascade = CascadeType.ALL,orphanRemoval=true)
@JoinColumns({ @JoinColumn(name = "schemaId", referencedColumnName = "schemaId"),
@JoinColumn(name = "overlayGroup", referencedColumnName = "overlayGroup") })
protected ArchiveEntity archive;


The sql error looks like this

Internal Exception: com.microsoft.sqlserver.jdbc.SQLServerException: An expression of non-boolean type specified in a context where a condition is expected, near ','.
Error Code: 4
145

Is this the known defect? Is there a workaround that I can use to make it work or has this issue been fixed in the latest 2.4.1 of eclipselink?

Any help is appreciated.

Thanks
P
 
Read Message
Read Message
Read Message
Read Message
Previous Topic:Scrollable ResultSet Exception "End of Stream"
Next Topic:Validate xml against multiple schema
Goto Forum:
  


Current Time: Fri May 24 10:17:57 EDT 2013

Powered by FUDForum. Page generated in 0.01684 seconds