Rakesh API

biz.wedoit4u.databeans
Class CustomerStyleHelper

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

final class CustomerStyleHelper
extends java.lang.Object

A helper class that provides convenient methods to interact with the customer_styles 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: CustomerStyleHelper.java,v 1.2 2004/05/26 11:42:31 rakesh Exp $
Author:
Rakesh Vidyadharan 21st October 2003

Field Summary
(package private) static java.lang.String ALL_CUSTOMER_STYLES
          The statement that is executed to fetch all the records from the customer_styles table.
(package private) static java.lang.String DELETE_CUSTOMER_STYLES
          The delete statement to be executed to delete a record in the customer_styles table.
(package private) static java.lang.String FIND_BY_CUSTOMER
          The statement that is executed to fetch all the records from the customer_styles table for the specified customer_id.
(package private) static java.lang.String INSERT_CUSTOMER_STYLES
          The statement that is executed to insert a new record into the customer_styles table.
(package private) static java.lang.String SELECT_CUSTOMER_STYLES
          The statement that is executed to fetch a specific record from the customer_styles table.
(package private) static java.lang.String UPDATE_CUSTOMER_STYLES
          The update statement to be executed to update a record in the customer_styles table.
 
Constructor Summary
private CustomerStyleHelper()
          Default constructor.
 
Method Summary
(package private) static void delete(int styleClassId, int customerId)
          Delete the record from the database identified by the primary key value specified.
(package private) static java.util.Collection findAll()
          Return a Collection of CustomerStylesPK objects that represent all the records in the customer_styles table.
(package private) static java.util.Collection findByCustomer(int customerId)
          Return a Collection of CustomerStylesPK objects that represent all the records in the customer_styles table that are associated with the specified customer_id.
(package private) static void insert(int styleClassId, int customerId, java.lang.String color, java.lang.String fontFamily, java.lang.String fontWeight, java.lang.String fontSize, java.lang.String backgroundColor, java.lang.String textAlign, java.lang.String verticalAlign, java.lang.String width, java.lang.String height, java.lang.String borderStyle, java.lang.String borderWidth, int paddingTop, int paddingLeft, int paddingRight, int paddingBottom, java.lang.String textDecoration)
          Insert a new record into the customer_styles table with the values specified.
(package private) static void select(CustomerStyleBean sab)
          Select the specified record from the customer_styles table.
(package private) static void update(CustomerStyleBean sab)
          Update the values in the customer_styles 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

ALL_CUSTOMER_STYLES

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

See Also:
Constant Field Values

FIND_BY_CUSTOMER

static final java.lang.String FIND_BY_CUSTOMER
The statement that is executed to fetch all the records from the customer_styles table for the specified customer_id.

See Also:
Constant Field Values

INSERT_CUSTOMER_STYLES

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

See Also:
Constant Field Values

SELECT_CUSTOMER_STYLES

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

See Also:
Constant Field Values

UPDATE_CUSTOMER_STYLES

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

See Also:
Constant Field Values

DELETE_CUSTOMER_STYLES

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

See Also:
Constant Field Values
Constructor Detail

CustomerStyleHelper

private CustomerStyleHelper()
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 CustomerStylesPK objects that represent all the records in the customer_styles 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.

findByCustomer

static final java.util.Collection findByCustomer(int customerId)
                                          throws java.sql.SQLException,
                                                 javax.naming.NamingException
Return a Collection of CustomerStylesPK objects that represent all the records in the customer_styles table that are associated with the specified customer_id.

Parameters:
customerId - - The customer_id value for which the matching primary key values are to be fetched.
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(CustomerStyleBean sab)
                  throws java.sql.SQLException,
                         javax.naming.NamingException
Select the specified record from the customer_styles table. The values selected from the database are used to set the values of the bean fields.

Parameters:
sab - - 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 void insert(int styleClassId,
                         int customerId,
                         java.lang.String color,
                         java.lang.String fontFamily,
                         java.lang.String fontWeight,
                         java.lang.String fontSize,
                         java.lang.String backgroundColor,
                         java.lang.String textAlign,
                         java.lang.String verticalAlign,
                         java.lang.String width,
                         java.lang.String height,
                         java.lang.String borderStyle,
                         java.lang.String borderWidth,
                         int paddingTop,
                         int paddingLeft,
                         int paddingRight,
                         int paddingBottom,
                         java.lang.String textDecoration)
                  throws java.sql.SQLException,
                         javax.naming.NamingException
Insert a new record into the customer_styles table with the values specified.

Parameters:
styleClassId - - The primary key value to use.
customerId - - The primary key value to use.
color - - The color style attribute.
fontFamily - - The font-family style attribute.
fontWeight - - The font-weight style attribute.
fontSize - - The font-size style attribute.
backgroundColor - - The background-color style attribute.
textAlign - - The text-align style attribute.
verticalAlign - - The vertical-align style attribute.
width - - The width style attribute.
height - - The height style attribute.
borderStyle - - The border-style style attribute.
borderWidth - - The border-width style attribute.
paddingTop - - The padding-top style attribute.
paddingLeft - - The padding-left style attribute.
paddingRight - - The padding-right style attribute.
paddingBottom - - The padding-bottom style attribute.
textDecoration - - The text-decoration style attribute.
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(CustomerStyleBean sab)
                  throws java.sql.SQLException,
                         javax.naming.NamingException
Update the values in the customer_styles table with the specified values.

Parameters:
sab - - 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 styleClassId,
                         int customerId)
                  throws java.sql.SQLException,
                         javax.naming.NamingException
Delete the record from the database identified by the primary key value specified.

Parameters:
styleClassId - - The style_class_id primary key value.
customerId - - The customer_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