Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Text Controls, CLOBs and Hibernate
Gavin
I am trying to report on a field inside a MySQL database table that BIRT accesses using Hibernate and a scripted data source. The native MySQL field type is "longtext".
In my report I am using a Text component to display the field. The correct dataset binding is in place, but instead of the field contents I see:
org.hibernate.lob.SerializableClob@1495510
I also tried to use a Dynamic Text display component but received the same result.
Could you please advise on how I can show the actual field contents on my report?
The code I currently have in place in my Text block screen control is
<textarea rows="14" cols="80" readonly="readonly">
<FONT size="medium" color="RGB(52,45,126)">
<VALUE-OF>row["ackmsg_messagecontent"]</VALUE-OF>
</FONT>
</textarea>
Thanks!
Find more posts tagged with
Comments
Virgil Dodson
Hi Gavin,<br />
<br />
Generally, you can select blob/clob type data directly from a database like the enclosed example.<br />
<br />
As for the Hibernate scripted data... how are you selecting and filling the longtext field.... I've not worked much with Hibernate but wonder if you have to use use something like getWrappedClob.... or getAsciiText on that field... If so, maybe you can do this in your scripted data source, in a calculated column, or in scripting...<br />
<br />
<a class='bbc_url' href='
https://www.hibernate.org/hib_docs/v3/api/org/hibernate/lob/SerializableClob.html'>https://www.hibernate.org/hib_docs/v3/api/org/hibernate/lob/SerializableClob.html</a><br
/>
<br />
<a class='bbc_url' href='
https://www.hibernate.org/112.html'>https://www.hibernate.org/112.html</a>
;
Gavin
Virgil...
Thanks for helping me to solve this. I edited my script to import org.hibernate.lob.SerializableClob and then just used the getSubstring() method of this class to get the contents of the field...
It was *so* obvious after you sent me the API for this class.. SerializableClob does not override the toString() method of java.lang.Object which it extends, so i just needed another equivalent method of doing this.
Brilliant - you've made the day.
Thanks,
Gavin.
Virgil Dodson
You are welcome. Glad it is working.