Rakesh API

biz.wedoit4u.databeans
Class CustomerTypeHelper

java.lang.Object
  extended by biz.wedoit4u.databeans.CustomerTypeHelper

final class CustomerTypeHelper
extends java.lang.Object

A helper class that provides convenient methods to interact with the customer_types table. This class is meant to be used from the DatabaseHelper class, or other classes in this package only.

Copyright 2003, Rakesh Vidyadharan and wedoit4u.biz

Version:
$Id: CustomerTypeHelper.java,v 1.4 2004/05/26 11:42:32 rakesh Exp $
Author:
Rakesh Vidyadharan 21st October 2003

Field Summary
(package private) static java.lang.String ALL_CUSTOMER_TYPES
          The statement that is executed to fetch all the records from the customer_types table.
(package private) static java.lang.String CUSTOMER_TYPE_ID_SEQUENCE
          The sequence set in the database for the customer_type_id primary key column.
(package private) static java.lang.String DELETE_CUSTOMER_TYPES
          The delete statement to be executed to delete a record in the customer_types table.
(package private) static java.lang.String INSERT_CUSTOMER_TYPES
          The statement that is executed to insert a new record into the customer_types table.
(package private) static java.lang.String SELECT_BY_PARTNER
          The statement that is executed to fetch all the records from the customer_types table for the specified partner_id.
(package private) static java.lang.String SELECT_CUSTOMER_TYPES
          The statement that is executed to fetch a specific record from the customer_types table.
(package private) static java.lang.String UPDATE_CUSTOMER_TYPES
          The update statement to be executed to update a record in the customer_types table.
 
Constructor Summary
private CustomerTypeHelper()
          Default constructor.
 
Method Summary
(package private) static void delete(int customerTypeId)
          Delete the record from the database identified by the primary key value specified.
(package private) static java.util.Collection findAll()
          Return a Collection of Integer values that represent all the primary key values in the customer_types table.
(package private) static java.util.Collection findByPartner(int partnerId)
          Return a Collection of Integer values that represent all the primary key values in the customer_types table that belong to the specified partner.
(package private) static int insert(int customerTypeId, java.lang.String type, java.lang.String description, int partnerId)
          Insert a new record into the customer_types table with the values specified.
(package private) static void select(CustomerTypeBean ctb)
          Select the specified record from the customer_types table.
(package private) static void update(CustomerTypeBean ctb)
          Update the values in the customer_types table with the specified values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CUSTOMER_TYPE_ID_SEQUENCE

static final java.lang.String CUSTOMER_TYPE_ID_SEQUENCE
The sequence set in the database for the customer_type_id primary key column.

See Also:
Constant Field Values

ALL_CUSTOMER_TYPES

static final java.lang.String ALL_CUSTOMER_TYPES
The statement that is executed to fetch all the records from the customer_types table.

See Also:
Constant Field Values

SELECT_BY_PARTNER

static final java.lang.String SELECT_BY_PARTNER
The statement that is executed to fetch all the records from the customer_types table for the specified partner_id.

See Also:
Constant Field Values

INSERT_CUSTOMER_TYPES

static final java.lang.String INSERT_CUSTOMER_TYPES
The statement that is executed to insert a new record into the customer_types table.

See Also:
Constant Field Values

SELECT_CUSTOMER_TYPES

static final java.lang.String SELECT_CUSTOMER_TYPES
The statement that is executed to fetch a specific record from the customer_types table.

See Also:
Constant Field Values

UPDATE_CUSTOMER_TYPES

static final java.lang.String UPDATE_CUSTOMER_TYPES
The update statement to be executed to update a record in the customer_types table.

See Also:
Constant Field Values

DELETE_CUSTOMER_TYPES

static final java.lang.String DELETE_CUSTOMER_TYPES
The delete statement to be executed to delete a record in the customer_types table.

See Also:
Constant Field Values
Constructor Detail

CustomerTypeHelper

private CustomerTypeHelper()
Default constructor. Cannot be instantiated.

Method Detail

findAll

static final java.util.Collection findAll()
                                   throws java.sql.SQLException,
                                          javax.naming.NamingException
Return a Collection of Integer values that represent all the primary key values in the customer_types table.

Returns:
Collection - The collection of primary key values.
Throws:
java.sql.SQLException - - If errors are encountered while fetching the records from the database.
javax.naming.NamingException - - If errors are encountered while getting a connection from the connection pool.

findByPartner

static final java.util.Collection findByPartner(int partnerId)
                                         throws java.sql.SQLException,
                                                javax.naming.NamingException
Return a Collection of Integer values that represent all the primary key values in the customer_types table that belong to the specified partner.

Returns:
Collection - The collection of primary key values.
Throws:
java.sql.SQLException - - If errors are encountered while fetching the records from the database.
javax.naming.NamingException - - If errors are encountered while getting a connection from the connection pool.

select

static final void select(CustomerTypeBean ctb)
                  throws java.sql.SQLException,
                         javax.naming.NamingException
Select the specified record from the customer_types table. The values selected from the database are used to set the values of the bean fields.

Parameters:
ctb - - The java bean instance that represents the record. The primary key value to use to look up the record is obtained from this bean.
Throws:
java.sql.SQLException - - If errors are encountered while fetching the record from the database.
javax.naming.NamingException - - If errors are encountered while getting a connection from the connection pool.

insert

static final int insert(int customerTypeId,
                        java.lang.String type,
                        java.lang.String description,
                        int partnerId)
                 throws java.sql.SQLException,
                        javax.naming.NamingException
Insert a new record into the customer_types table with the values specified.

Parameters:
customerTypeId - - The primary key values to use. If this is 0, then the next value from the CUSTOMER_TYPE_ID_SEQUENCE is used.
type - - The type value.
description - - The description value.
partnerId - - The partner_id value.
Throws:
java.sql.SQLException - - If database errors are encountered while writing to the database.
javax.naming.NamingException - - If errors are encountered while getting a connection from the connection pool.

update

static final void update(CustomerTypeBean ctb)
                  throws java.sql.SQLException,
                         javax.naming.NamingException
Update the values in the customer_types table with the specified values.

Parameters:
ctb - - The java bean that represents a record in the database.
Throws:
java.sql.SQLException - - If database errors are encountered while writing to the database.
javax.naming.NamingException - - If errors are encountered while getting a connection from the connection pool.

delete

static final void delete(int customerTypeId)
                  throws java.sql.SQLException,
                         javax.naming.NamingException
Delete the record from the database identified by the primary key value specified.

Parameters:
customerTypeId - - The customer_type_id primary key value.
Throws:
java.sql.SQLException - - If database errors are encountered while writing to the database.
javax.naming.NamingException - - If errors are encountered while getting a connection from the connection pool.

Rakesh API

Copyright © 2002-2005 - Rakesh Vidyadharan