Issue Details (XML | Word | Printable)

Key: HSEARCH-248
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Hardy Ferentschik
Reporter: Isaac F
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Hibernate Search

Incorrect syntax near ',' with org.hibernate.dialect.SQLServerDialect

Created: 07/Aug/08 07:36 AM   Updated: 15/Jan/10 02:23 PM   Resolved: 06/Mar/09 11:28 AM
Component/s: query
Affects Version/s: 3.0.1.GA
Fix Version/s: 3.1.0.Beta1

Time Tracking:
Not Specified

Environment: Sql Server 2005, hibernate 3.2.6
Issue Links:
Duplicate
 
Relates
 

Bug Testcase Reminder (view):
REMINDER: Bug reports should generally be accompanied by a test case
Participants: Arturo Frappé, azael espinosa, Emmanuel Bernard, Hardy Ferentschik and Isaac F


 Description  « Hide

I get this exception when I make a createFullTextQuery with an Entity that have composite-id (I use TwoWayStringBridge impl to transform)

org.hibernate.util.JDBCExceptionReporter[main] - SQL Error: 102, SQLState: S0001
org.hibernate.util.JDBCExceptionReporter[main] - Incorrect syntax near ','.

A generated query is this:

/* criteria query */ select
this_.CE_CIF as CE1_0_0_,
this_.CE_FORMA_JURIDICA as CE2_0_0_,
this_.CE_DISCRIMINANTE as CE3_0_0_,
this_.CE_DELEGACION as CE4_0_0_,
from
CH_TERCEROS this_
where
(
(
this_.CE_CIF, this_.CE_FORMA_JURIDICA, this_.CE_DISCRIMINANTE, this_.CE_DELEGACION
) in (
(
?, ?, ?, ?
), (
?, ?, ?, ?
), (
?, ?, ?, ?
), (
?, ?, ?, ?
), (
?, ?, ?, ?
), (
?, ?, ?, ?
), (
?, ?, ?, ?
), (
?, ?, ?, ?
), (
?, ?, ?, ?
), (
?, ?, ?, ?
), (
?, ?, ?, ?
), (
?, ?, ?, ?
), (
?, ?, ?, ?
), (
?, ?, ?, ?
), (
?, ?, ?, ?
), (
?, ?, ?, ?
), (
?, ?, ?, ?
), (
?, ?, ?, ?
)
)
)

but this syntax is not support by Sql Server 2005

Thanks



Emmanuel Bernard added a comment - 08/Aug/08 04:50 PM

I fixed this bug in 3.1.0.Beta1. Any change you can give it a try.


Arturo Frappé added a comment - 05/Mar/09 05:24 PM

I found this bug again in 3.1.0.GA, then I tested with 3.1.0.Beta1 and again.

Please giveme a hint where to debug, and what to do.

Thanks


Hardy Ferentschik added a comment - 06/Mar/09 10:50 AM

DocumentBuilderIndexedEntity contains a flag 'safeFromTupleId' which is set when the metadata is created. This flag is the used in MultiClassesQueryLoader to determine how to load objects. So there is definitely some code which should at least take care of the scenario. Need to check if there is a test case.


Hardy Ferentschik added a comment - 06/Mar/09 11:28 AM

There is actually a bug. After the split of DocumentBuilder into DocumentBuilderIndexedEntity and documentBuilderContainedEntity line 151 should have changed to

safeFromTupleId = TwoWayString2FieldBridgeAdaptor.class.isAssignableFrom( idBridge.getClass() );


azael espinosa added a comment - 15/Jan/10 12:59 PM

Where is DocumentBuilderIndexedEntity?
I have the same problem, but do not find that
I'm a little lost

HSEARCH-445


Arturo Frappé added a comment - 15/Jan/10 01:23 PM

Azael, this issue was fixed on Hibernate Search 3.1.1
Try to look at org.hibernate.search.engine.DocumentBuilderIndexedEntity if you dare.


azael espinosa added a comment - 15/Jan/10 01:58 PM

Thanks for answering.

I have a question but since I am newbie

I only used the seam jars that are in, because it creates the project via seam-gen which generates all by itself.

download Hibernate Search 3.1.1 and I put the libraries in my project or on jboss?
I could explain how to use it?

excuse my newbie question


Hardy Ferentschik added a comment - 15/Jan/10 02:23 PM

This is not a forum. You should ask this kind of things on the Hibernate Search forum.