【发布时间】:2008-10-08 14:51:04
【问题描述】:
在这种情况下,是否有可能让 hibernate 为某些“正确”值做“正确的事情”?
from ClassA a, ClassB b
where a.prop = b.prop
问题是 prop 是一个在连接表中具有不同表示的 UserType。在表 A 中,它表示为整数,在表 B 中,它表示为 char。所以 eq 测试转换看 1 == 'a' 或多或少,这是错误的,但由 1 或 'a' 表示的对象应该是相同的,因此它们应该比较为真。
【问题讨论】: