First, thanks for your help.
Here is the different pieces of code you might need
(My DAO extends HibernateDAOSupport in springframework, thats why getHibernateTemplate() is used)
Code:
/**
* @see com.thalys.opalys.domain.RegularityFormDao#loadAll()
*/
@SuppressWarnings({"unchecked"})
public java.util.Collection<com.thalys.opalys.domain.RegularityForm> loadAll()
{
return this.loadAll(TRANSFORM_NONE);
}
Code:
/**
* @see com.thalys.opalys.domain.RegularityFormDao#loadAll(int)
*/
public java.util.Collection loadAll(final int transform)
{
final java.util.Collection results = this.getHibernateTemplate().loadAll(com.thalys.opalys.domain.RegularityFormImpl.class);
this.transformEntities(transform, results);
return results;
}
Code:
/**
* Transforms a collection of entities using the
* {@link #transformEntity(int,com.thalys.opalys.domain.RegularityForm)}
* method. This method does not instantiate a new collection.
* <p/>
* This method is to be used internally only.
*
* @param transform one of the constants declared in <code>com.thalys.opalys.domain.RegularityFormDao</code>
* @param entities the collection of entities to transform
* @see #transformEntity(int,com.thalys.opalys.domain.RegularityForm)
*/
protected void transformEntities(final int transform, final java.util.Collection entities)
{
switch (transform)
{
case TRANSFORM_REGULARITYFORMDETAIL :
toRegularityFormDetailCollection(entities);
break;
case TRANSFORM_REGULARITYFORMLISTITEM :
toRegularityFormListItemCollection(entities);
break;
case TRANSFORM_NONE : // fall-through
default:
// do nothing;
}
}
I really saw those UPDATE on loadAll... and yet, can there be any flush of uncommited changes made at this moment??
I'll have a look at chatper 10 section 10