<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
thanks - I forgot the "insert sql literals into the insert/update/query
sql"&nbsp; requirement :)<br>
<br>
/max<br>
<br>
Rob Hasselbaum wrote:
<blockquote cite="mid:4AA5940F.60902@hasselbaum.net" type="cite">
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
  <title></title>
On 09/07/2009 06:37 PM, Max Rydahl Andersen wrote:<br>
  <blockquote cite="mid:4AA58B35.4050606@redhat.com" type="cite">
    <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
What is this doing that a parameterized custom type can't do ? Is this
"just" to get a cleaner hbm.xml syntax or ?<br>
    <br>
/max</blockquote>
  <br>
  <font size="-1"><font face="Helvetica, Arial, sans-serif">Hi Max,<br>
  <br>
It addresses two issues that a custom type cannot address. First, it
enables calling database functions that don't have an equivalent (or
efficient) Java implementation. And second, since the conversion logic
happens inside the database, relational operations can be applied to
the decoded value such as sorting and non-equality searching.<br>
  <br>
For example, my primary use case is encryption. We have implemented an
encryption package inside Oracle and we don't wish to replicate that
logic in Java. But more importantly, there are certain fields that the
business has told us we must encrypt (for example, the user's last
name), but we still need to be able to sort on the plain text values
and do partial-match searches using the LIKE operator. This can't be
achieved with a custom type; the conversion must happen inside the
database.<br>
  <br>
Regards,<br>
-Rob<br>
  </font></font></blockquote>
</body>
</html>