Hi.
The same question was asked
here.
When using Blob-fields in n-to-m-relations Hibernate and MSSQL are failing for some reason.
Code:
SQL Error: 421, SQLState: S0001
The image data type cannot be selected as DISTINCT because it is not comparable.
...
could not initialize a collection: [Dataset.documents#someID]
My classes look as follows:
Code:
@Entity
class Dataset {
@OneToMany(fetch = FetchType.LAZY)
public List<Document> documents = new ArrayList<Document>();
}
Code:
@Entity
class Document {
@Id
public long id;
@Lob
public byte[] data;
}
Any ideas on this? I already tried using a Set or Document[] to avoid the errors. It seems that Hibernate always tries a distinct SELECT on my tables. How can I workaround this?
Thanks in advanced.
Jan