Rakesh API

biz.wedoit4u.ejb.entity
Class EntityBeanProvider

java.lang.Object
  extended by biz.wedoit4u.ejb.entity.EntityBeanProvider

public final class EntityBeanProvider
extends java.lang.Object

This class provides static accessor methods that provide a convenient means of getting references to the various EJB's developed for the TMS Webservices initiative. The methods defined in this class simply invoke the appropriate finder methods for accessing entity beans.

Version:
$Id: EntityBeanProvider.java,v 1.4 2004/05/26 11:42:35 rakesh Exp $
Author:
Rakesh Vidyadharan 10th September 2003
See Also:

Copyright 2003, Rakesh Vidyadharan and wedoit4u.biz


Field Summary
private static Categories categories
          A reference to the Contents home object for the Category entity bean.
private static Contents contents
          A reference to the Categories home object for the Content entity bean.
private static Customers customers
          A reference to the Customers home object for the Customer entity bean.
private static CustomerTypes customerTypes
          A reference to the CustomerTypes home object for the CustomerType entity bean.
private static javax.naming.InitialContext initialContext
          A reference to the application servers InitialContext.
private static SiteProperties siteProperties
          A reference to the SiteProperties home object for the SiteProperty entity bean.
 
Constructor Summary
private EntityBeanProvider()
          Default constructor.
 
Method Summary
static java.util.Collection getAllCategories()
          Return a Collection of reference to the Category entity beans that represent all the records in the customer_id table.
static java.util.Collection getAllContents()
          Return a Collection of Content entity bean instances that represent all the records in the contents table.
static java.util.Collection getAllCustomers()
          Return a Collection of references to all the entity bean instances that represent all the records in the customers table.
static java.util.Collection getAllCustomerTypes()
          Return a collection of all the CustomerType entity bean instances that represent all the rows in the customer_type table.
static java.util.Collection getAllSiteProperties()
          Return a Collection of entity beans of type SiteProperty that represent all the records in the site_properties table.
static Categories getCategories()
          Fetch the home object for the Category entity bean.
static Category getCategory(int categoryId)
          Return a reference to the Category entity bean identified by the primary key value specified.
static java.util.Collection getCategoryByCustomer(Customer customer)
          Return a Collection of reference to the Category entity beans that belong to the specified customer_id.
static Content getContent(int contentId)
          Return a reference to the Content entity bean identified by the primary key value specified.
static java.util.Collection getContentByCategory(Category category)
          Return a Collection of Content entity bean instances that are associated with the specified Category.
static Contents getContents()
          Fetch the home object for the Contents entity bean.
static Customer getCustomer(int customerId)
          Return a reference to the Customer entity bean.
static Customer getCustomer(java.lang.String username)
          Return a reference to the Customer entity bean.
static java.util.Collection getCustomerByCustomerType(CustomerType customerType)
          Return a Collection of entity bean instances that represent all the records in the customers table, that belong to the specified CustomerType.
static Customers getCustomers()
          Fetch the home object for the Customer entity bean.
static CustomerType getCustomerType(int customerTypeId)
          Return a reference to the CustomerType entity bean.
static CustomerType getCustomerType(java.lang.String type)
          Return a reference to the CustomerType entity bean identified by the type value.
static CustomerTypes getCustomerTypes()
          Fetch the home object for the CustomerType entity bean.
static SiteProperties getSiteProperties()
          Fetch the home object for the SiteProperty entity bean.
static SiteProperty getSiteProperty(int customerId)
          Return a reference to the SiteProperty entity bean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

initialContext

private static javax.naming.InitialContext initialContext
A reference to the application servers InitialContext. This reference is fetched only once for the sake of efficiency.


customerTypes

private static CustomerTypes customerTypes
A reference to the CustomerTypes home object for the CustomerType entity bean. This reference is fetched only once for the sake of efficiency.


customers

private static Customers customers
A reference to the Customers home object for the Customer entity bean. This reference is fetched only once for the sake of efficiency.


categories

private static Categories categories
A reference to the Contents home object for the Category entity bean. This reference is fetched only once for the sake of efficiency.


contents

private static Contents contents
A reference to the Categories home object for the Content entity bean. This reference is fetched only once for the sake of efficiency.


siteProperties

private static SiteProperties siteProperties
A reference to the SiteProperties home object for the SiteProperty entity bean. This reference is fetched only once for the sake of efficiency.

Constructor Detail

EntityBeanProvider

private EntityBeanProvider()
Default constructor. Cannot be instantiated.

Method Detail

getCustomerTypes

public static final CustomerTypes getCustomerTypes()
                                            throws javax.naming.NamingException
Fetch the home object for the CustomerType entity bean. The reference is fetched only if the customerTypes reference is null.

Returns:
CustomerTypes - The home object.
Throws:
javax.naming.NamingException - - Any errors encountered while getting a reference to the application servers InitialContext.

getCustomerType

public static final CustomerType getCustomerType(int customerTypeId)
                                          throws javax.ejb.FinderException,
                                                 javax.naming.NamingException
Return a reference to the CustomerType entity bean.

Parameters:
customerTypeId - - The customerType_id column value by which the appropriate bean instance is to be fetched.
Returns:
CustomerType - The reference to the appropriate instance of the CustomerType bean.
Throws:
javax.ejb.FinderException - - Any errors encountered while looking up the associated bean instance specified by the userId value.
javax.naming.NamingException - - Any errors encountered while getting a reference to the customerTypes home object.

getCustomerType

public static final CustomerType getCustomerType(java.lang.String type)
                                          throws javax.ejb.FinderException,
                                                 javax.naming.NamingException
Return a reference to the CustomerType entity bean identified by the type value.

Parameters:
type - - The type column value by which the appropriate bean instance is to be fetched.
Returns:
CustomerType - The reference to the appropriate instance of the CustomerType bean.
Throws:
javax.ejb.FinderException - - Any errors encountered while looking up the associated bean instance specified by the username value.
javax.naming.NamingException - - Any errors encountered while getting a reference to the customerTypes home object.

getAllCustomerTypes

public static final java.util.Collection getAllCustomerTypes()
                                                      throws javax.ejb.FinderException,
                                                             javax.naming.NamingException
Return a collection of all the CustomerType entity bean instances that represent all the rows in the customer_type table.

Returns:
Collection - The collection of references to the entity bean instances.
Throws:
javax.ejb.FinderException - - Any errors encountered while looking up the associated bean instance specified by the username value.
javax.naming.NamingException - - Any errors encountered while getting a reference to the customerTypes home object.

getCustomers

public static final Customers getCustomers()
                                    throws javax.naming.NamingException
Fetch the home object for the Customer entity bean. The reference is fetched only if the customers reference is null.

Returns:
Customers - The home object.
Throws:
javax.naming.NamingException - - Any errors encountered while getting a reference to the application servers InitialContext.

getCustomer

public static final Customer getCustomer(int customerId)
                                  throws javax.ejb.FinderException,
                                         javax.naming.NamingException
Return a reference to the Customer entity bean.

Parameters:
customerId - - The customer_id column value by which the appropriate bean instance is to be fetched.
Returns:
Customer - The reference to the appropriate instance of the Customer bean.
Throws:
javax.ejb.FinderException - - Any errors encountered while looking up the associated bean instance specified by the userId value.
javax.naming.NamingException - - Any errors encountered while getting a reference to the customers home object.

getCustomer

public static final Customer getCustomer(java.lang.String username)
                                  throws javax.ejb.FinderException,
                                         javax.naming.NamingException
Return a reference to the Customer entity bean.

Parameters:
username - - The username column value by which the appropriate bean instance is to be fetched.
Returns:
Customer - The reference to the appropriate instance of the Customer bean.
Throws:
javax.ejb.FinderException - - Any errors encountered while looking up the associated bean instance specified by the username value.
javax.naming.NamingException - - Any errors encountered while getting a reference to the customers home object.

getCustomerByCustomerType

public static final java.util.Collection getCustomerByCustomerType(CustomerType customerType)
                                                            throws javax.naming.NamingException,
                                                                   javax.ejb.FinderException
Return a Collection of entity bean instances that represent all the records in the customers table, that belong to the specified CustomerType.

Parameters:
customerType - - The customer type for which the collection of customers is to be retrieved.
Returns:
Collection - The collection of bean instances.
Throws:
javax.naming.NamingException - - Any errors encountered while getting a reference to the customers home object.
javax.ejb.FinderException - - If errors are encountered while fetching the appropriate instances.

getAllCustomers

public static final java.util.Collection getAllCustomers()
                                                  throws javax.ejb.FinderException,
                                                         javax.naming.NamingException
Return a Collection of references to all the entity bean instances that represent all the records in the customers table.

Returns:
Collection - The references to the entity bean instances.
Throws:
javax.ejb.FinderException - - Any errors encountered while looking up the associated bean instance specified by the username value.
javax.naming.NamingException - - Any errors encountered while getting a reference to the customers home object.

getCategories

public static final Categories getCategories()
                                      throws javax.naming.NamingException
Fetch the home object for the Category entity bean. The reference is fetched only if the categories reference is null.

Returns:
Categorys - The home object.
Throws:
javax.naming.NamingException - - Any errors encountered while getting a reference to the home object from the application servers InitialContext.

getCategory

public static final Category getCategory(int categoryId)
                                  throws javax.ejb.FinderException,
                                         javax.naming.NamingException
Return a reference to the Category entity bean identified by the primary key value specified.

Parameters:
categoryId - - The category_id column value by which the appropriate bean instance is to be fetched.
Returns:
Category - The reference to the appropriate instance of the Category bean.
Throws:
javax.ejb.FinderException - - Any errors encountered while looking up the associated bean instance specified by the categoryId value.
javax.naming.NamingException - - Any errors encountered while getting a reference to the home object from the application servers InitialContext.

getCategoryByCustomer

public static final java.util.Collection getCategoryByCustomer(Customer customer)
                                                        throws javax.ejb.FinderException,
                                                               javax.naming.NamingException
Return a Collection of reference to the Category entity beans that belong to the specified customer_id.

Parameters:
customer - - The customer_id column value by which the appropriate bean instances are to be fetched. The customer_id value is represented by its entity bean representation.
Returns:
Collection - The references to the appropriate instances of the Category bean.
Throws:
javax.ejb.FinderException - - Any errors encountered while looking up the associated bean instance specified by the userId value.
javax.naming.NamingException - - Any errors encountered while getting a reference to the home object from the application servers InitialContext.

getAllCategories

public static final java.util.Collection getAllCategories()
                                                   throws javax.ejb.FinderException,
                                                          javax.naming.NamingException
Return a Collection of reference to the Category entity beans that represent all the records in the customer_id table.

Returns:
Collection - The references to the appropriate instances of the Category bean.
Throws:
javax.ejb.FinderException - - Any errors encountered while looking up the associated bean instance specified by the userId value.
javax.naming.NamingException - - Any errors encountered while getting a reference to the home object from the application servers InitialContext.

getContents

public static final Contents getContents()
                                  throws javax.naming.NamingException
Fetch the home object for the Contents entity bean. This reference is fetched only if the contents is null.

Returns:
Contents - The home object.
Throws:
javax.naming.NamingException - - Any errors encountered while getting a reference to the home object from the application servers InitialContext.

getContent

public static final Content getContent(int contentId)
                                throws javax.ejb.FinderException,
                                       javax.naming.NamingException
Return a reference to the Content entity bean identified by the primary key value specified.

Parameters:
contentId - - The content_id column value by which the appropriate bean instance is to be fetched.
Returns:
Content - The reference to the appropriate instance of the Content bean.
Throws:
javax.ejb.FinderException - - Any errors encountered while looking up the associated bean instance specified by the deviceTypeId value.
javax.naming.NamingException - - Any errors encountered while getting a reference to the home object from the application servers InitialContext.

getAllContents

public static final java.util.Collection getAllContents()
                                                 throws javax.ejb.FinderException,
                                                        javax.naming.NamingException
Return a Collection of Content entity bean instances that represent all the records in the contents table.

Returns:
Collection - A collection of references to valid entity beans representing the content records.
Throws:
javax.ejb.FinderException - - If errors are encountered while finding devices for the specified customer.
javax.naming.NamingException - - Any errors encountered while getting a reference to the home object from the application servers InitialContext.

getContentByCategory

public static final java.util.Collection getContentByCategory(Category category)
                                                       throws javax.ejb.FinderException,
                                                              javax.naming.NamingException
Return a Collection of Content entity bean instances that are associated with the specified Category.

Parameters:
category - - The category_id for which all the Content instances are to be retrieved using the related Category entity bean instance.
Returns:
Collection - A collection of references to valid entity beans representing the contents associated with the category.
Throws:
javax.ejb.FinderException - - If errors are encountered while finding devices for the specified customer.
javax.naming.NamingException - - Any errors encountered while getting a reference to the home object from the application servers InitialContext.

getSiteProperties

public static final SiteProperties getSiteProperties()
                                              throws javax.naming.NamingException
Fetch the home object for the SiteProperty entity bean. This reference is fetched only if the siteProperties is null.

Returns:
SiteProperties - The home object.
Throws:
javax.naming.NamingException - - Any errors encountered while getting a reference to the home object from the application servers InitialContext.

getSiteProperty

public static final SiteProperty getSiteProperty(int customerId)
                                          throws javax.ejb.FinderException,
                                                 javax.naming.NamingException
Return a reference to the SiteProperty entity bean.

Parameters:
customerId - - The customer_id column value by which the appropriate bean instance is to be fetched.
Returns:
SiteProperty - The reference to the appropriate instance of the SiteProperty bean.
Throws:
javax.ejb.FinderException - - Any errors encountered while looking up the associated bean instance specified by the userId value.
javax.naming.NamingException - - Any errors encountered while getting a reference to the customers home object.

getAllSiteProperties

public static final java.util.Collection getAllSiteProperties()
                                                       throws javax.ejb.FinderException,
                                                              javax.naming.NamingException
Return a Collection of entity beans of type SiteProperty that represent all the records in the site_properties table.

Returns:
Collection - The collection of entity bean instances.
Throws:
javax.ejb.FinderException - - Any errors encountered while looking up the associated bean instance specified by the userId value.
javax.naming.NamingException - - Any errors encountered while getting a reference to the customers home object.

Rakesh API

Copyright © 2002-2005 - Rakesh Vidyadharan