Hi,

I run the subtask hibernatDAO in the middlegen task. As mentioned before
on this list. You need to specify the variable "getHibernateSession" when
using hibernate 2.x. (I am using 2.1)

<hibernateDAO getHibernateSession="${getHibernateSession}.getSession();"/>

I have a few comments on the template.
First you need to specify the ';'. Which is not very need but okay.
The second is that the template produces a java file that is incorrect.

    /**
     * Insert the object into the database.
     *
     * @param obj The object to save.
     *
     * @return The primary key of the newly inserted object.
     */
    public Serializable save( AttributeName obj ) throws HibernateException
    {
        Session hibSession =
nl.ekc.hibernate.factory.FactoryClass.getSessionFactory().openSession();
        Serializable retval = hibSession.save( obj );

        return serializable;
    }

the return is of course not 'serializable' but 'retval'

I haven't looked at the template yet but it look like an easy fix.
Since I'm not realy sure wether I want to use the hibernateDAO, I was just
curious what it did :), I'll comment it out. But someone might find it
usefull, that's why I'm posting it.

Regards, Wouter Boers




-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
middlegen-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/middlegen-user

Reply via email to