l***@ikke.net
2005-01-13 07:46:09 UTC
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
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