KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > xpetstore > web > webwork > action > cart > CheckoutAction


1 /*
2  * Created on Feb 25, 2003
3  */

4 package xpetstore.web.webwork.action.cart;
5
6 import cirrus.hibernate.Session;
7
8 import xpetstore.domain.Customer;
9
10
11 /**
12  * @author <a HREF="mailto:tchbansi@sourceforge.net">Herve Tchepannou</a>
13  *
14  * @webwork.action
15  * name="checkout"
16  * success="checkout.vm"
17  */

18 public class CheckoutAction
19     extends BaseCartAction
20 {
21     //~ Instance fields --------------------------------------------------------
22

23     private Customer _customer = new Customer( );
24
25     //~ Methods ----------------------------------------------------------------
26

27     /**
28      * @see webwork.action.ActionSupport#doExecute()
29      */

30     protected String JavaDoc doExecute( )
31         throws Exception JavaDoc
32     {
33         Session s = getHibernateSession( );
34
35         try
36         {
37             _customer = ( Customer ) s.load( Customer.class, getUserId( ) );
38
39             return SUCCESS;
40         }
41         finally
42         {
43             s.close( );
44         }
45     }
46
47     /**
48      * @return Customer
49      */

50     public Customer getCustomer( )
51     {
52         return _customer;
53     }
54
55     /**
56      * Sets the customer.
57      * @param customer The customer to set
58      */

59     public void setCustomer( Customer customer )
60     {
61         _customer = customer;
62     }
63 }
64
Popular Tags