Hi,<br><br>I've submitted a patch with unit tests for HHH-272 and I'm interested in feedback. The patch allows users to specify custom SQL get and set expressions for property columns. This can be used to call SQL functions or perform some other kind of database-side conversion without giving up automatic statement generation. You use it like this:<br>
<br><property name="creditCardNumber"><br> <column name="credit_card_num" sql-set="encrypt(?)" sql-get="decrypt(credit_card_num)"/><br></property><br><br>This is similar to a formula property with two differences. First, the data is backed by a real column, which gets exported with the schema. And second. the data is read-write, not read-only. The sql-get expression gets applied in predicates, order clauses, projections, etc.<br>
<br>The patch should work for all property columns including those in components and composite-elements. I didn't try to get id, key, index, or other kinds of non-property columns to work. It is built on top of the <a href="http://3.3.2.GA">3.3.2.GA</a> tag, but I can port it to trunk if necessary. I also have a patch nearly ready to expose this functionality in Hibernate Annotations in case the Core patch is accepted. If any commiters could have a look, I'd appreciate it.<br>
<br>Thanks for your time,<br>-Rob Hasselbaum<br>