package org.objectweb.jonas.jtests.beans.ejbql;

import javax.ejb.EntityContext;
import javax.ejb.FinderException;
import org.objectweb.jonas.jtests.beans.ejbql.ShipLocal;

public abstract class CabinBean  implements javax.ejb.EntityBean {

    public Integer ejbCreate(Integer id) throws javax.ejb.CreateException {
	this.setId(id);
	return null; 
    }
    public void ejbPostCreate(Integer id){
		
    }
    public abstract void setId(Integer id);
    public abstract Integer getId();
 
    public abstract void setShip(ShipLocal ship);
    public abstract ShipLocal getShip( );

    public abstract void setName(String name);
    public abstract String getName( );

    public abstract void setBedCount(int count);
    public abstract int getBedCount( );

    public abstract void setDeckLevel(int level);
    public abstract int getDeckLevel( );

    // abstract ejbSelect() methods
    public abstract int ejbSelectDeckLevel(Integer i) throws FinderException;


    public int getShipId() {
	return getShip().getId().intValue();
    }

    public void setShipId(int sp) {
	ShipLocal sl = getShip( );
	sl.setId(new Integer(sp));
	setShip(sl);
    }

	// Public Home method required to test the private ejbSelectXXXX method
    public int ejbHomeSelectDeckLevel(Integer id) throws FinderException {
		return this.ejbSelectDeckLevel(id);
	}

    public void setEntityContext(EntityContext ctx) {
         // Not implemented.
    }
    public void unsetEntityContext() {
         // Not implemented.
    }
    public void ejbActivate() {
        // Not implemented.
    }
    public void ejbPassivate() {
        // Not implemented.
    }
    public void ejbLoad() {
        // Not implemented.
    }
    public void ejbStore() {
        // Not implemented.
    }
    public void ejbRemove() throws javax.ejb.RemoveException {
        // Not implemented.
    }
}
