I've posted this as its own topic, so if you're busy don't let me bug you...
Hibernate version: 2.1.7c
Name and version of the database you are using: Firebird 1.5.2
This seems like a simple thing but I can't seem to get it to work...
We have a main object Printer that has a Map of Feature objects, and the Feature objects in turn have a Map of Setting objects. The key in each map is the feature or setting name, so Printer might have one map entry whose key is the String "NetworkFeature" and whose value is a NetworkFeature object.
I can attach the *.hbm.xml if necessary later but I'm hoping you can just look at my query and see something dumb I'm doing :-)
I can execute THIS query, and I get back a list of the Printer objects that have a NetworkFeature element that has a contactName setting:
select distinct p from Printer p where p.features['NetworkFeature'].settings['contactName'] is not null);
But when I try to check for a specific contactName, like this:
select distinct p from Printer p where p.features['NetworkFeature'].settings['contactName']
='John Smith'"
I get this exception:
Code:
org.springframework.jdbc.UncategorizedSQLException: (Hibernate operation): encountered SQLException [GDS Exception. 335544334. conversion error from string "John Smith"]; nested exception is org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544334. conversion error from string "John Smith"
org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544334. conversion error from string "John Smith"
at org.firebirdsql.jdbc.AbstractPreparedStatement.internalExecute(AbstractPreparedStatement.java:503)
at ...
I have tried replacing the 'John Smith' in the query with ? and :contactName and calling setString, setText, setParameter and all sorts of variations, but I can't seem to get this to work.
Any ideas???
-Jeff