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

import java.util.Collection;

import javax.ejb.EntityContext;
import javax.ejb.CreateException;
import javax.ejb.FinderException;
import javax.ejb.RemoveException;

public abstract class ShipBean implements javax.ejb.EntityBean {
    
    public Integer ejbCreate(Integer primaryKey, String name, double tonnage) throws CreateException {
	setId(primaryKey);
	setName(name);
	setTonnage(tonnage);
	return null;
    }
	
    public void ejbPostCreate(Integer primaryKey, String name, double tonnage) {
    }

    // persistent fields

    public abstract void setId(Integer id);
    public abstract Integer getId();
    public abstract void setName(String name);
    public abstract String getName( );
    public abstract void setTonnage(double tonnage);
    public abstract double getTonnage( );

    // abstract ejbSelect() methods
    public abstract double ejbSelectAverageOfTonnage() throws FinderException;
    public abstract Collection ejbSelectListOfTonnage() throws FinderException;

	// Public Home method required to test the private ejbSelectXXXX method
	public double ejbHomeGetAverageOfTonnage() throws FinderException {
		return this.ejbSelectAverageOfTonnage();
	}

    // standard call back methods    
    public void setEntityContext(EntityContext ec){}
    public void unsetEntityContext(){}
    public void ejbLoad(){}
    public void ejbStore(){}
    public void ejbActivate(){}
    public void ejbPassivate(){}
    public void ejbRemove() throws RemoveException {}

}
