[Andromda-user] [Hibernate cartridge] [updates on a CLOB that was only read]

View: New views
1 Messages — Rating Filter:   Alert me  

Parent Message unknown [Andromda-user] [Hibernate cartridge] [updates on a CLOB that was only read]

by "Widas" (AndroMDA Forum) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I know that this is an old thread, but I had the problem with update-on-read for Entities holding a clob type,too.

Obfuscator's recommendation works here.

This is what I do:

in mda/src/main/config/mappings, I created a file "HibernateExtensionMappings.xml" with the following content:


<?xml version="1.0" encoding="ISO-8859-1" ?>
<!--
 Fixes/extends original AndroMDA Hibernate Mappings, which you find in HibernateTypeMappings.xml
-->
<mappings name="HibernateExtension">
   <extends>Hibernate</extends>
    <mapping>
        <from>datatype::Clob</from>
            <!-- Map to text, as the HibernateStringClobType causes an update after read
                 if the attribute is NULL
                   See http://galaxy.andromda.org/forum/viewtopic.php?t=4583 -->
        <!--to>org.andromda.persistence.hibernate.usertypes.HibernateStringClobType</to-->
        <to>text</to>
    </mapping>
</mappings>



And in mda/src/main/config/andromda.xml, change to:

        <property name="hibernateTypeMappingsUri">file:${conf.dir}/mappings/HibernateExtensionMappings.xml</property>



With this, the update-on-read problem is fixed here.
Tested with AndroMDA 3.2
_________________________________________________________
Reply to the post : http://galaxy.andromda.org/forum/viewtopic.php?p=28192#28192
Posting to http://forum.andromda.org/ is preferred over posting to the mailing list!

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference