My problem is this...
I've got a mapping that uses:
Code:
<sql-insert>
insert into payment_subscriber_account_fund
(fund_id, subscriber_id, account_number,
account_holder_name, expiry_date, is_active, full_account_number)
values (?, ?, ?, ?, ?, ?, aes_encrypt(?, '&key;'))
</sql-insert>
This was working fine in hibernate 3.0 but I've upgraded my JBoss server from 4.0.3 to 4.0.4 and hibernate has upgraded with it. Now the sql produced doesn't include the aes_encrypt value. After turning on show_sql=true I can see it do this...
Code:
insert into payment_subscriber_account_fund (fund_id, subscriber_id, account_number, account_holder_name, expiry_date, is_active, full_account_number) values (?, ?, ?, ?, ?, ?, ?)
Mine seems to be the correct syntax according to the documentation, and I've found one mention of this in another forum that wasn't answered. I'm assuming that this is still possible. The full mapping is as follows:
**********************************************************
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"
[<!ENTITY key "grGWcw$+BrC6ya($F0[CFx}GYsWdpi-Pzte-tj7rm_wr4J65v,kObyS2sS;">]
>
<hibernate-mapping>
<class name="com.telrock.mpayment.vo.SubscriberAccountFundVO"
table="payment_subscriber_account_fund" lazy="false">
<id name="id" type="integer" column="id">
<generator class="identity"/>
</id>
<property type="integer" name="fundId">
<column name="fund_id" not-null="true"/>
</property>
<property type="integer" name="subscriberId">
<column name="subscriber_id" not-null="true"/>
</property>
<property type="string" name="accountNumber">
<column name="account_number" not-null="true"/>
</property>
<property type="string" name="accountHolderName">
<column name="account_holder_name" not-null="false"/>
</property>
<property type="string" name="expiryDate">
<column name="expiry_date" not-null="false"/>
</property>
<property type="boolean" name="active">
<column name="is_active" not-null="true"/>
</property>
<property type="string" name="fullAccountNumber">
<column name="full_account_number" not-null="true"/>
</property>
<loader query-ref="payment_subscriber_account_fund"/>
<sql-insert>
insert into payment_subscriber_account_fund
(fund_id, subscriber_id, account_number, account_holder_name, expiry_date, is_active, full_account_number)
values (?, ?, ?, ?, ?, ?, aes_encrypt(?, '&key;'))
</sql-insert>
<sql-update>
update payment_subscriber_account_fund set fund_id=?, subscriber_id=?, account_number=?,
account_holder_name=?, expiry_date=?, is_active=?, full_account_number=aes_encrypt(?,'&key;') where id=?
</sql-update>
</class>
</hibernate-mapping>
Any help would be greatly appreciated!