FileDocCategorySizeDatePackage
RentABikeAccounts.javaAPI DocExample575Mon Apr 25 09:33:56 BST 2005com.springbook

RentABikeAccounts.java

package com.springbook;

import org.springframework.orm.hibernate.support.HibernateDaoSupport;

import java.util.List;

public class RentABikeAccounts extends HibernateDaoSupport implements Accounts {
   public List getTxs() {
      return getHibernateTemplate().find("from MonetaryTransaction");
   }

   public MonetaryTransaction getTx(int id) {
     return (MonetaryTransaction)getHibernateTemplate().
           load(MonetaryTransaction.class, new Integer(id)); 
   }

   public void addTx(MonetaryTransaction tx) {
      getHibernateTemplate().saveOrUpdate(tx);
   }
}