我认为您可以使用
<formula>映射文件中关系上的标记来执行此操作。
例如:
<many-to-one name="myClassB" > <formula>--Some SQL expression that converts between ClassA.prop and ClassB.prop</formula></many-to-one>
我用它来关联两个表,其中一个使用整数,但将其关联到另一个表中的char字段。这可能不完全是您想要的,但是也许它将使您走上正确的轨道。

我认为您可以使用
<formula>映射文件中关系上的标记来执行此操作。
例如:
<many-to-one name="myClassB" > <formula>--Some SQL expression that converts between ClassA.prop and ClassB.prop</formula></many-to-one>
我用它来关联两个表,其中一个使用整数,但将其关联到另一个表中的char字段。这可能不完全是您想要的,但是也许它将使您走上正确的轨道。