I have the following property in my hbm.xml files:
Code:
<property name="xml" type="materialized_clob" column="XDD_XML" not-null="true" length="1000000000" />
It's fine most of the time but sometime we really have objects big enough to justify this length which is not very nice for the memory.
So I decided to use real clob to stream a bit more all that.
The constraint is that I can't break any Java or HQL API so I have to keep the current String "xml" based property and the corresponding String get/setXml(). I was expecting to find some kind of alias system that would allow me to say that "xml" property lead to another method now which is Clob based instead but look like there is nothing like this (maybe there is in version more recent than 3.6.9 ?).
So I did the following:
Code:
<property name="xmlClob" type="clob" column="XDD_XML" not-null="true" length="1000000000" />
<!-- The "real" Hibernate property is "xmlClob". "xml" property is here to allow the use of the more intuitive "xml" name in requests -->
<property name="xml" update="false" insert="false" type="materialized_clob" column="XDD_XML" not-null="true" length="1000000000" />
I have corresponding Clob get/setXmlClob() methods and all seemed OK but then I discovered that Hibernate still call getXml() when inserting my entity which make everything I did pretty much useless from memory footprint improvement point of view.
I know, 3.6.9 is quite old. But before trying to upgrade (or some nasty hack) I would like to understand why it does that. Is there something I did not understood ? Is this just not very optimized implementation in this version that have been improved in more recent version ? Is it still like this and there is nothing I can do without breaking my API ?