FileDocCategorySizeDatePackage
KodoRentABike.javaAPI DocExample2820Mon Apr 25 00:00:16 BST 2005com.springbook

KodoRentABike.java

package com.springbook;

import org.springframework.orm.jdo.JdoTemplate;
import org.springframework.orm.jdo.support.JdoDaoSupport;

import java.util.Collection;
import java.util.Date;
import java.util.List;


public class KodoRentABike extends JdoDaoSupport implements RentABike {
   public void transferReservation(Reservation oldRes, Reservation newRes) {
      //To change body of implemented methods use File | Settings | File Templates.
   }

    private String storeName;

    public List getBikes() {
        return (List)getJdoTemplate().find(Bike.class);
    }

    public Collection getBikesColl() {
        JdoTemplate jdo = getJdoTemplate();
        Collection results = jdo.find(Bike.class);
        return results;
    }

    public Bike getBike(String serialNo) {
        Collection c = getJdoTemplate().find(Bike.class, "serialNo == '" + serialNo + "'");
        Bike b = null;
        if(c.size() > 0) {
            b = (Bike)c.iterator().next();
        }
        return b;
    }

    public Bike getBike(int bikeId) {
        return (Bike)getJdoTemplate().getObjectById(Bike.class, new Long(bikeId));
    }

    public void saveBike(Bike bike) {
        getJdoTemplate().makePersistent(bike);
    }

    public void deleteBike(Bike bike) {
        getJdoTemplate().deletePersistent(bike);
    }

    public void setStoreName(String name) {
        this.storeName = name;
    }

    public String getStoreName() {
        return this.storeName;
    }

    public List getCustomers() {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }

    public Customer getCustomer(int custId) {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }

    public void saveCustomer(Customer customer) {
        //To change body of implemented methods use File | Settings | File Templates.
    }

    public void deleteCustomer(Customer customer) {
        //To change body of implemented methods use File | Settings | File Templates.
    }

    public List getReservations() {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }

    public List getReservations(Customer customer) {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }

    public List getReservations(Bike bike) {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }

    public List getReservations(Date date) {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }

    public Reservation getReservation(int resId) {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }



}