package examples.hibernate.client;

import org.seasar.framework.container.S2Container;
import org.seasar.framework.container.factory.S2ContainerFactory;

import examples.hibernate.dao.EmployeeAutoDao;
import examples.hibernate.entity.Employee;

public class EmployeeAutoDaoClient {

	private static final String PATH = 
				"examples/hibernate/client/EmployeeAutoDao.dicon";

	public static void main(String[] args) {
		S2Container container = S2ContainerFactory.create(PATH);/* 롨룈1 */
		container.init();
		try {
			EmployeeAutoDao dao = (EmployeeAutoDao) container
					.getComponent(EmployeeAutoDao.class);/* 롨룈괧괧괧괧2 */
			Employee emp = new Employee();
			emp.setEmpno( 7788);
			emp.setEname("SCOTT");
			emp.setDeptno((short)10);

			dao.save( emp );	/* 롨룈3 */
					
//			dao.delete( emp );	

		} finally {
			container.destroy();
		}

	}
}