Ok, I have looked into the templates for the hibernate Embedded Values and 
found an error. I have fixed it in my local repository, but it will need to be 
added to the source for it to work in the current release.



The change was in HibernateEmbeddedValue.vsl from : 





    /**

     * Creates a new instance from other $embeddedValue.name instance.

     */

    public static ${embeddedValue.name} 
new${embeddedValue.name}Instance($embeddedValue.name otherObject)

    {

        if (otherObject != null)

        {

            return new${embeddedValue.name}Instance(

                #foreach ($attribute in $embeddedValue.attributes)

                                        
otherObject.${attribute.getterName}()#if($velocityCount != 
$embeddedValue.attributes.size()),#end

                                #end

                        );

        }

        return null;

    }







to :







    /**

     * Creates a new instance from other $embeddedValue.name instance.

     */

    public static ${embeddedValue.name} newInstance($embeddedValue.name 
otherObject)

    {

        if (otherObject != null)

        {

            return newInstance(

                #foreach ($attribute in 
$embeddedValue.attributes)otherObject.${attribute.getterName}()#if($velocityCount
 != $embeddedValue.attributes.size()),#end#end);

        }

        return null;

    }





This will correctly generate the code for the newInstance method when the 
supplied object has no attributes.



m.
_________________________________________________________
Reply to the post : http://galaxy.andromda.org/forum/viewtopic.php?p=1730#1730
Posting to http://forum.andromda.org/ is preferred over posting to the mailing 
list!


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Andromda-user mailing list
Andromda-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/andromda-user

Reply via email to