001 package biz.wedoit4u.ejb.entity;
002
003 import java.util.Collection;
004 import javax.ejb.CreateException;
005 import javax.ejb.EJBLocalHome;
006 import javax.ejb.FinderException;
007
008 /**
009 * The local home interface to the entity bean that represents a record
010 * in the <code>categories</code> table.
011 *
012 * <p>Copyright 2003, Rakesh Vidyadharan and wedoit4u.biz</p>
013 *
014 * @author Rakesh Vidyadharan 9<sup><small>th</small></sup> September 2003
015 * @version $Id: Categories.java,v 1.3 2004/05/26 11:42:33 rakesh Exp $
016 */
017 public interface Categories extends EJBLocalHome
018 {
019 /**
020 * Create a new <code>category</code> record with just the required
021 * values. This method obtains the next <code>sequence</code> value
022 * for the <code>category_id</code> value, and sets the <code>
023 * category_id</code> value to the <code>sequence value</code>.
024 *
025 * @see biz.wedoit4u.databeans.DatabaseHelper#getNextSequenceValue( String )
026 *
027 * @param customer - The reference to the entity bean that
028 * represents a record in the <code>customer</code> table. This
029 * will be used to set the <code>foreign key customer_id</code>
030 * column.
031 * @param menuName - The value for the <code>menu_name</code>
032 * column.
033 * @param longName - The value for the <code>long_name</code>
034 * column.
035 * @throws CreateException - If errors are encountered while creating
036 * the new record.
037 */
038 public Category create( Customer customer, String menuName,
039 String longName ) throws CreateException;
040
041 /**
042 * Create a new <code>category</code> record with all the column
043 * values. This method obtains the next <code>sequence</code> value
044 * for the <code>category_id</code> value, and sets the <code>
045 * category_id</code> value to the <code>sequence value</code>.
046 *
047 * @see biz.wedoit4u.databeans.DatabaseHelper#getNextSequenceValue( String )
048 *
049 * @param customer - The reference to the entity bean that
050 * represents a record in the <code>customer</code> table. This
051 * will be used to set the <code>foreign key customer_id</code>
052 * column.
053 * @param menuName - The value for the <code>menu_name</code>
054 * column.
055 * @param longName - The value for the <code>long_name</code>
056 * column.
057 * @param brief - The value for the <code>brief</code> column.
058 * @param picture - The value for the <code>picture</code>
059 * column.
060 * @param description - The value for the <code>description
061 * </code> column.
062 * @throws CreateException - If errors are encountered while creating
063 * the new record.
064 */
065 public Category create( Customer customer, String menuName,
066 String longName, String brief, String picture,
067 String description ) throws CreateException;
068
069 /**
070 * Return the entity bean instance that represents the record in
071 * the <code>categories</code> table identified by the <code>primary
072 * key</code> column (<code>category_id</code>).
073 *
074 * @param categoryId - The primary key value based on which to
075 * look up the record.
076 * @return Collection - The collection of entity bean instances.
077 * @throws FinderException - If errors are encountered while finding
078 * the appropriate bean instance.
079 */
080 public Category findByPrimaryKey( int categoryId ) throws FinderException;
081
082 /**
083 * Return a <code>Collection</code> of entity bean instances that
084 * match the <code>customer_id</code> specified. This finder returns
085 * all the categories belonging to the specified customer.
086 *
087 * @param customer - The <code>customer_id</code> for which
088 * the matching bean instances are to be returned.
089 * @throws FinderException - If errors are encountered while finding
090 * the appropriate bean instance.
091 */
092 public Collection findByCustomer( Customer customer ) throws FinderException;
093
094 /**
095 * Return a <code>Collection</code> of entity bean instances that
096 * represent all the records in the <code>categories</code> table.
097 *
098 * @return Collection - The collection of entity bean instances.
099 * @throws FinderException - If errors are encountered while finding
100 * the appropriate bean instance.
101 */
102 public Collection findAll() throws FinderException;
103 }