package net.roseindia.action;

import net.roseindia.dao.CustomerInfoDAO;
import net.roseindia.model.CustomerModel;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

public class HibernateStrutsInsert extends ActionSupport implements
		ModelDriven<CustomerModel> {
	CustomerInfoDAO obInfoDAO = new CustomerInfoDAO();
	CustomerModel obModel;

	@Override
	public String execute() throws Exception {
		return SUCCESS;
	}

	public String dataInsert() {
		obInfoDAO.saveInfo(obModel);
		System.out.println("inserted");
		return SUCCESS;
	}

	@Override
	public CustomerModel getModel() {
		// TODO Auto-generated method stub
		obModel = new CustomerModel();

		return obModel;
	}

}
