001 package biz.wedoit4u.ejb.entity;
002
003 import java.util.Collection;
004 import java.util.Date;
005 import javax.ejb.CreateException;
006 import javax.ejb.EJBLocalHome;
007 import javax.ejb.FinderException;
008
009 /**
010 * The local home interface to the entity bean that represents a record
011 * in the <code>customers</code> table.
012 *
013 * <p>Copyright 2003, Rakesh Vidyadharan and wedoit4u.biz</p>
014 *
015 * @author Rakesh Vidyadharan 9<sup><small>th</small></sup> September 2003
016 * @version $Id: Customers.java,v 1.3 2004/05/26 11:42:35 rakesh Exp $
017 */
018 public interface Customers extends EJBLocalHome
019 {
020 /**
021 * Create a new <code>customers</code> record with just the values
022 * for the required columns. This method obtains the next
023 * <code>sequence</code> value for the <code>customer_id</code>
024 * value, and sets the <code>customer_id</code> value to the
025 * <code>sequence value</code>. The value for the <code>active</code>
026 * will be set to the default value specified for the column in the
027 * database.
028 *
029 * @see biz.wedoit4u.databeans.DatabaseHelper#getNextSequenceValue( String )
030 * @param username - The <code>username</code> value.
031 * @param password - The <code>password</code> value.
032 * @param customerType - The <code>customer_type_id</code> represented
033 * by the entity bean instance.
034 * @return Customer - An entity bean representing the new record.
035 * @throws CreateException - If errors are encountered while creating
036 * the new record.
037 */
038 public Customer create( String username, String password,
039 CustomerType customerType ) throws CreateException;
040
041 /**
042 * Create a new <code>customers</code> record with just the values
043 * for the required columns. This method obtains the next
044 * <code>sequence</code> value for the <code>customer_id</code>
045 * value, and sets the <code>customer_id</code> value to the
046 * <code>sequence value</code>.
047 *
048 * @see biz.wedoit4u.databeans.DatabaseHelper#getNextSequenceValue( String )
049 * @param username - The <code>username</code> value.
050 * @param password - The <code>password</code> value.
051 * @param active - The <code>active</code> value.
052 * @param customerType - The <code>customer_type_id</code> represented
053 * by the entity bean instance.
054 * @return Customer - An entity bean representing the new record.
055 * @throws CreateException - If errors are encountered while creating
056 * the new record.
057 */
058 public Customer create( String username, String password,
059 char active, CustomerType customerType ) throws CreateException;
060
061 /**
062 * Create a new <code>customers</code> record with the values
063 * specified for all the columns in the table. This method
064 * obtains the next <code>sequence</code> value for the
065 * <code>customer_id</code> value, and sets the <code>
066 * customer_id</code> value to the <code>sequence value</code>.
067 *
068 * @see biz.wedoit4u.databeans.DatabaseHelper#getNextSequenceValue( String )
069 * @param username - The <code>username</code> value.
070 * @param password - The <code>password</code> value.
071 * @param email - The <code>email</code> value. This
072 * may be <code>null</code>.
073 * @param domain - The <code>domain</code> value. This
074 * may be <code>null</code>.
075 * @param active - The <code>active</code> value.
076 * @param creationDate - The <code>creation_date</code> value.
077 * @param activationDate - The <code>activation_date</code> value.
078 * @param expirationDate - The <code>expiration_date</code> value.
079 * @param customerType - The <code>customer_type_id</code> represented
080 * by the entity bean instance.
081 * @throws CreateException - If errors are encountered while creating
082 * the new record.
083 */
084 public Customer create( String username, String password,
085 String email, String domain, char active, Date creationDate,
086 Date activationDate, Date expirationDate,
087 CustomerType customerType ) throws CreateException;
088
089 /**
090 * Return the entity bean instance identified by the primary key
091 * value specified.
092 *
093 * @param customerId - The customer_id value by which to
094 * find the appropriate bean instance.
095 * @return Customer - The appropriate entity bean instance.
096 * @throws FinderException - If errors are encountered while fetching
097 * the appropriate instance.
098 */
099 public Customer findByPrimaryKey( int customerId ) throws FinderException;
100
101 /**
102 * Find the entity bean instance that is identified by the
103 * <code>username</code> specified.
104 *
105 * @param username - The username value by which to
106 * find the appropriate bean instance.
107 * @return Customer - The appropriate entity bean instance.
108 * @throws FinderException - If errors are encountered while fetching
109 * the appropriate bean instance.
110 */
111 public Customer findByUsername( String username ) throws FinderException;
112
113 /**
114 * Return a <code>Collection</code> of entity bean instances that
115 * represent all the records in the <code>customers</code> table,
116 * that belong to the specified {@link CustomerType}.
117 *
118 * @param customerType - The customer type for which
119 * the collection of customers is to be retrieved.
120 * @return Collection - The collection of bean instances.
121 * @throws FinderException - If errors are encountered while fetching
122 * the appropriate instances.
123 */
124 public Collection findByCustomerType( CustomerType customerType ) throws FinderException;
125
126 /**
127 * Return a <code>Collection</code> of entity bean instances that
128 * represent all the records in the <code>customers</code> table.
129 *
130 * @return Collection - The collection of bean instances.
131 * @throws FinderException - If errors are encountered while fetching
132 * the appropriate instances.
133 */
134 public Collection findAll() throws FinderException;
135 }