Rakesh API

biz.wedoit4u.databeans
Class SitePropertyHelper

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

final class SitePropertyHelper
extends java.lang.Object

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

Field Summary
(package private) static java.lang.String ALL_SITE_PROPERTIES
          The statement that is executed to fetch all the records from the site_properties table.
(package private) static java.lang.String DELETE_SITE_PROPERTIES
          The delete statement that is executed to delete a record in the site_properties table identified by the primary key value.
(package private) static java.lang.String INSERT_SITE_PROPERTIES
          The statement that is executed to insert a new record into the site_properties table.
(package private) static java.lang.String NULL_CLOBS
          The statement that is used to empty the contents of the header and footer clob columns prior to updating them.
(package private) static java.lang.String SELECT_SITE_PROPERTIES
          The statement that is executed to fetch a specific record from the site_properties table.
(package private) static java.lang.String UPDATE_CLOBS
          The statement that is used to set the value of the header and footer clob columns.
(package private) static java.lang.String UPDATE_SITE_PROPERTIES
          The update statement to be executed to update a record in the content_types table.
 
Constructor Summary
private SitePropertyHelper()
          Default constructor.
 
Method Summary
(package private) static void delete(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 Integer values that represent all the primary key values in the site_properties table.
(package private) static void insert(int customerId, int topRail, int leftRail, int rightRail, int bottomRail)
          Insert a new record into the site_properties table with the values specified.
(package private) static void insert(int customerId, int topRail, int leftRail, int rightRail, int bottomRail, java.lang.String header, java.lang.String footer)
          Insert a new record into the site_properties table with the values specified.
private static void nullClobFields(int customerId)
          Reset the header and footer column values to empty strings.
(package private) static void select(SitePropertyBean spb)
          Select the specified record from the site_properties table.
(package private) static void update(SitePropertyBean spb)
          Update the values in the site_properties table with the specified values.
private static void updateClobFields(int customerId, java.lang.String header, java.lang.String footer)
          Write the specified string values to the header and footer clob columns.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALL_SITE_PROPERTIES

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

See Also:
Constant Field Values

INSERT_SITE_PROPERTIES

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

See Also:
Constant Field Values

SELECT_SITE_PROPERTIES

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

See Also:
Constant Field Values

UPDATE_SITE_PROPERTIES

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

See Also:
Constant Field Values

DELETE_SITE_PROPERTIES

static final java.lang.String DELETE_SITE_PROPERTIES
The delete statement that is executed to delete a record in the site_properties table identified by the primary key value.

See Also:
Constant Field Values

NULL_CLOBS

static final java.lang.String NULL_CLOBS
The statement that is used to empty the contents of the header and footer clob columns prior to updating them.

See Also:
Constant Field Values

UPDATE_CLOBS

static final java.lang.String UPDATE_CLOBS
The statement that is used to set the value of the header and footer clob columns.

See Also:
Constant Field Values
Constructor Detail

SitePropertyHelper

private SitePropertyHelper()
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 site_properties 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(SitePropertyBean spb)
                  throws java.sql.SQLException,
                         javax.naming.NamingException
Select the specified record from the site_properties table. The values selected from the database are used to set the values of the bean fields.

Parameters:
spb - - 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 customerId,
                         int topRail,
                         int leftRail,
                         int rightRail,
                         int bottomRail)
                  throws java.sql.SQLException,
                         javax.naming.NamingException
Insert a new record into the site_properties table with the values specified. The header and footer columns are set to singe spaces.

Parameters:
customerId - - The primary key value to use.
topRail - - The top_rail value.
leftRail - - The left_rail value.
rightRail - - The right_rail value.
bottomRail - - The bottom_rail 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.
See Also:
nullClobFields( int )

insert

static final void insert(int customerId,
                         int topRail,
                         int leftRail,
                         int rightRail,
                         int bottomRail,
                         java.lang.String header,
                         java.lang.String footer)
                  throws java.sql.SQLException,
                         javax.naming.NamingException
Insert a new record into the site_properties table with the values specified.

Parameters:
customerId - - The primary key value to use.
topRail - - The top_rail value.
leftRail - - The left_rail value.
rightRail - - The right_rail value.
bottomRail - - The bottom_rail value.
header - - The header value.
footer - - The footer 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.
See Also:
insert( int, int, int, int, int ), updateClobFields( int, String, String )

update

static final void update(SitePropertyBean spb)
                  throws java.sql.SQLException,
                         javax.naming.NamingException
Update the values in the site_properties table with the specified values.

Parameters:
spb - - 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.
See Also:
nullClobFields( int ), updateClobFields( int, String, String )

nullClobFields

private static final void nullClobFields(int customerId)
                                  throws java.sql.SQLException,
                                         javax.naming.NamingException
Reset the header and footer column values to empty strings.

Parameters:
customerId - - The primary key value whose body is to be updated.
Throws:
java.sql.SQLException - - If errors are encountered while writing to the database.
javax.naming.NamingException - - If errors are encountered while getting a connection from the connection pool.

updateClobFields

private static final void updateClobFields(int customerId,
                                           java.lang.String header,
                                           java.lang.String footer)
                                    throws java.sql.SQLException,
                                           javax.naming.NamingException
Write the specified string values to the header and footer clob columns.

Note: The existings contents in the header and footer columns should be truncated prior to invoking this method if you wish to have the desired content in the columns. This method will set the first header.length() and footer.length() characters of the header and footer columns respectively to the strings specified.

Parameters:
customerId - - The primary key value whose body is to be updated.
header - - The new header value.
footer - - The new footer value.
Throws:
java.sql.SQLException - - If 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 customerId)
                  throws java.sql.SQLException,
                         javax.naming.NamingException
Delete the record from the database identified by the primary key value specified.

Parameters:
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