Methods Summary |
---|
public void | deleteBike(Bike bike)
getHibernateTemplate().delete(bike);
|
public void | deleteCustomer(Customer customer)
getHibernateTemplate().delete(customer);
|
public Bike | getBike(java.lang.String serialNo)
Bike b = null;
List bikes = getHibernateTemplate().find("from Bike where serialNo = '" + serialNo + "'");
if(bikes.size() > 0) {
b = (Bike)bikes.get(0);
}
return b;
|
public Bike | getBike(int bikeId)
return (Bike)getHibernateTemplate().load(Bike.class, new Integer(bikeId));
|
public java.util.List | getBikes()
return getHibernateTemplate().find("from Bike");
|
public java.util.List | getBikesOldWay()
List bikes = null;
Session s = null;
try {
s = getHibernateTemplate().getSessionFactory().openSession();
bikes = s.find("from Bike");
}catch (Exception ex) {
//handle exception gracefully
}finally {
s.close();
}
return bikes;
|
public Customer | getCustomer(int custId)
return (Customer)getHibernateTemplate().load(Customer.class, new Integer(custId));
|
public java.util.List | getCustomers()
return getHibernateTemplate().find("from Customer");
|
public java.lang.String | getName()
return name;
|
public Reservation | getReservation(int resId)
return (Reservation)getHibernateTemplate().load(Reservation.class, new Integer(resId));
|
public java.util.List | getReservations()
return getHibernateTemplate().find("from Reservation");
|
public java.util.List | getReservations(Customer customer)
return getHibernateTemplate().find("from Reservation where custId = " + customer.getCustId());
|
public java.util.List | getReservations(Bike bike)
return getHibernateTemplate().find("from Reservation where bikeId = " + bike.getBikeId());
|
public java.util.List | getReservations(java.util.Date date)
return getHibernateTemplate().find("from Reservation where resdate = ?", date);
|
public java.lang.String | getStoreName()
return this.name;
|
public void | saveBike(Bike bike)
System.out.println("To save or update: " + bike);
getHibernateTemplate().saveOrUpdate(bike);
|
public void | saveCustomer(Customer customer)
getHibernateTemplate().saveOrUpdate(customer);
|
public void | setName(java.lang.String name)
this.name = name;
|
public void | setStoreName(java.lang.String name)
this.name = name;
|