Hibernate version:
3.x
Mapping documents:
Code:
<set name="foo" table="foo" order-by="name">
<key column="parent_id" />
<composite-element class="Bar">
<property access="field" name="name" />
<property access="field" name="surname" />
<property access="field" name="story" type="text" />
</composite-element>
</set>
Full stack trace of any exception that occurs:Code:
org.hibernate.exception.GenericJDBCException: could not delete collection rows: [Bla#1]
...
Caused by: java.sql.SQLException: The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.
Name and version of the database you are using:SQL Server 2000
The generated SQL (show_sql=true):Code:
delete from bla where parent_id=? and name=? and surname=? and story=?
Hello
I've got a class which has a Set of Bars. I store them as composite-elements, without an auto-incremented ID. As such, when trying to delete one of those Bars in the set, hibernate tries to match all fields to locate that row.
Bar has fields "name", "surname", "story". The last field, story, is of type text and, as shown in the exception, comparison cannot be achieved.
This works fine in MySQL. But what happens in SQL Server?
Can I signify in the mapping that I only want name and surname to be used for the equality in the generated sql statement?
thanks