Using this mapping:
Code:
<set name="paymentMethods" table="country_payment_method">
<key column="code"/>
<many-to-many
column="payment_method_id"
class="PaymentMethod"
where="active = true"
/>
</set>
I get a Postgres error from the following generated SQL:
Code:
select paymentmet0_.code as code1_, paymentmet0_.payment_method_id as payment2_1_, paymentmet1_.id as id0_, paymentmet1_.broker as broker9_0_, paymentmet1_.label as label9_0_, paymentmet1_.fee as fee9_0_, paymentmet1_.free as free9_0_, paymentmet1_.active as active9_0_, paymentmet1_.merchant_identifier as merchant7_9_0_, paymentmet1_.username as username9_0_, paymentmet1_.password as password9_0_ from country_payment_method paymentmet0_ inner join payment_method paymentmet1_ on paymentmet0_.payment_method_id=paymentmet1_.id where paymentmet1_.active=paymentmet1_.true and paymentmet0_.code=?
It seems like the "true" literal value is being treated as a field name. This looks like a bug to me. Should I report it?
bye
John