Rakesh API

biz.wedoit4u.databeans
Class StyleClassHelper

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

final class StyleClassHelper
extends java.lang.Object

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

Field Summary
(package private) static java.lang.String ALL_STYLE_CLASSES
          The statement that is executed to fetch all the records from the style_classes table.
(package private) static java.lang.String DELETE_STYLE_CLASSES
          The delete statement to be executed to delete a record in the style_classes table.
(package private) static java.lang.String INSERT_STYLE_CLASSES
          The statement that is executed to insert a new record into the style_classes table.
(package private) static java.lang.String SELECT_STYLE_CLASSES
          The statement that is executed to fetch a specific record from the style_classes table.
(package private) static java.lang.String STYLE_CLASS_ID_SEQUENCE
          The sequence set in the database for the style_class_id primary key column.
(package private) static java.lang.String UPDATE_STYLE_CLASSES
          The update statement to be executed to update a record in the style_classes table.
 
Constructor Summary
private StyleClassHelper()
          Default constructor.
 
Method Summary
(package private) static void delete(int styleClassId)
          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 style_classes table.
(package private) static int insert(int styleClassId, java.lang.String className, java.lang.String description)
          Insert a new record into the style_classes table with the values specified.
(package private) static void select(StyleClassBean scb)
          Select the specified record from the style_classes table.
(package private) static void update(StyleClassBean scb)
          Update the values in the style_classes 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

STYLE_CLASS_ID_SEQUENCE

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

See Also:
Constant Field Values

ALL_STYLE_CLASSES

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

See Also:
Constant Field Values

INSERT_STYLE_CLASSES

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

See Also:
Constant Field Values

SELECT_STYLE_CLASSES

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

See Also:
Constant Field Values

UPDATE_STYLE_CLASSES

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

See Also:
Constant Field Values

DELETE_STYLE_CLASSES

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

See Also:
Constant Field Values
Constructor Detail

StyleClassHelper

private StyleClassHelper()
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 style_classes 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.

select

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

Parameters:
scb - - 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 styleClassId,
                        java.lang.String className,
                        java.lang.String description)
                 throws java.sql.SQLException,
                        javax.naming.NamingException
Insert a new record into the style_classes table with the values specified.

Parameters:
styleClassId - - The primary key values to use. If this is 0, then the next value from the STYLE_CLASS_ID_SEQUENCE is used.
className - - The class_name value.
description - - The description 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(StyleClassBean scb)
                  throws java.sql.SQLException,
                         javax.naming.NamingException
Update the values in the style_classes table with the specified values.

Parameters:
scb - - 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)
                  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.
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