Hi,

I have never worked with Spring so I am probably the wrong person to ask about this. I am also sorry to say that, although I would like to learn something about Spring, I simply have not got the time at the moment. Maybe there will be better times.

This does NOT mean that I am not willing to help you in your effort, but my comments will not be very Spring aware. Simply post any questions you got to the Torque users list (maybe this will also attract more
people who are interested to use Torque with Spring)

Please keep us informed about your progress

          Thomas

On Thu, 19 May 2005 [EMAIL PROTECTED] wrote:

Hello,

My name is John Menke.  A long time back i contributed some documentation
to the Torque project (torque 2).

Recently, I have started a development effort to integrate Torque with the
Spring Framework.

On advice from Rod Johnson i have been following a simple plan:


  <advice on how to implement ORM support in Spring>
  The basic concepts you'd want to consider are resource acquisition and
  release, error handling, and transaction management. The Spring code is
  of course the best place to look.

  You would probably implement the following artifacts:

  - Template (like JdbcTemplate or HibernateTemplate)
  - Exception translator to map from ORM exceptions into
  DataAccessException hierarchy
  - DaoSupport class, like JdbcDaoSupport, that provides a convenient
  (optional) superclass for implementing user DAOs
  - Session factory implementation, like LocalSessionFactoryBean

  You could also look at the chapter on data access inJ2EE without EJB,
  which explains the concepts.

  Rgds
  Rod[/list]
  </advice on how to implement ORM support in Spring>


   I have started work on the above and posted this message to the Spring
   Developer List and Spring DAO forum.

   If someone from the torque development would be interested in guiding
   me I think I will have a better chance of getting this done.  Any
   takers?

   <post to spring-dev>

   Following the pattern of what is out there already i have created
   stubbed out classes for 2 packages:

   org.springframework.orm.torque
   -TorqueAccessor
   -TorqueCallback
   -TorqueOperations
   -TorqueJDBCException
   -TorqueTemplate
   org.springframework.orm.torque.support
   -TorqueDaoSupport

   Following the current design patterns in the other Spring ORM
   implementations, i coded the TorqueOperations interface. The methods
   defined in it are the methods that Torque makes available to it's
   persistence classes defined in org.apache.torque.util.BasePeer.

   In the template i plan to delegate the calls into template methods to
   a BasePeer object (POJO with all static methods).

   Something like this:

   Code:
   public List doSelect(org.apache.torque.util.Criteria criteria)
   throws DataAccessException {

   List returnList = null;

   try {
   returnList = this.getTorqueBasePeer().doSelect(criteria);
   } catch (TorqueException e) {
   convertTorqueAccessException(e);
   }

   return returnList;
   }

   Is this a correct approach? Is there any place i can share this code
   with others that are interested?

   -jm

   <post to spring-dev>

   Thanks in advance for any help.

   JM













John Menke

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to