## ---------------------------------------------------------------------------
## JOnAS: Java(TM) Open Application Server
## Copyright (C) 1999-2004 Bull S.A.
## Contact: jonas-team@objectweb.org
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation; either
## version 2.1 of the License, or any later version.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with this library; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
## USA
##
## Initial developer(s): Helene Joanin.
## Contributor(s): ______________________________________.
##
## ---------------------------------------------------------------------------
## $Id: JEntityHandle.vm 11877 2007-10-29 13:59:20Z fornacif $
## ---------------------------------------------------------------------------

//
// This class is the bean specific part of org.ow2.jonas.lib.ejb21.JEntityHandle.
// Generated by JOnAS's GenIC tool via Velocity.
// DO NOT EDIT THIS FILE.
// Start: $Id: JEntityHandle.vm 11877 2007-10-29 13:59:20Z fornacif $

#if ($package.length() != 0)
package $package;
#end

import java.rmi.RemoteException;

import javax.ejb.EJBObject;
import javax.ejb.HomeHandle;
import javax.rmi.PortableRemoteObject;

import org.ow2.jonas.lib.ejb21.JEntityHome;
import org.ow2.jonas.lib.ejb21.JEntityHandle;

import org.ow2.carol.rmi.exception.RmiUtility;


public class $class extends JEntityHandle {


    public $class($remote_wrp ejbobject) {
        super(ejbobject);
        try {
            pk = ($pk)ejbobject.getPrimaryKey();
        } catch (Exception e) {
            pk = null;
        }
    }

    public EJBObject getEJBObject() throws RemoteException {

        #beforeThrowRemoteException()

        $remote ejbobj = null;
        try {
            $home h = ($home)PortableRemoteObject.narrow(homehandle.getEJBHome(),${home}.class);
            ejbobj = h.findByPrimaryKey(($pk)pk);
        } catch (Exception e) {
            throw new RemoteException("${class}.getEJBObject(): "+e, e);
        }
        return ejbobj ;

        #afterThrowRemoteException()

    }

}
// End: $Id: JEntityHandle.vm 11877 2007-10-29 13:59:20Z fornacif $
