package org.seasar.hibernate.dao.impl;

import java.io.Serializable;
import java.lang.reflect.Method;

import org.seasar.hibernate.S2Session;
import org.seasar.hibernate.S2SessionFactory;

/**
 * @author kenichi_okazaki
 */
public class LoadCommand extends AbstractHibernateCommand{
	private Class beanClass_;
	private Method method_;
	
	public LoadCommand(S2SessionFactory s2sessionFactory,Class beanClass, Method method) {
		super(s2sessionFactory);
		beanClass_ = beanClass;
		method_ = method;
	}

	/* (”ñ Javadoc)
	 * @see org.srasar.hibernate.dao.HibernateCommand#execute(org.seasar.hibernate.S2Session, java.lang.Object[])
	 */
	public Object execute( Object[] args) {
		S2Session s2session = getS2Session();
		return s2session.load(beanClass_,(Serializable) args[0]);
		
	}




}
