Rakesh API

biz.wedoit4u.ejb.session
Class DatabaseActionBean

java.lang.Object
  extended by biz.wedoit4u.ejb.session.SessionBeanAdapter
      extended by biz.wedoit4u.ejb.session.DatabaseActionBean
All Implemented Interfaces:
java.io.Serializable, javax.ejb.EnterpriseBean, javax.ejb.SessionBean

public class DatabaseActionBean
extends SessionBeanAdapter

The implementation of the DatabaseAction session bean. This class abstracts the data transformations to be affected on the tables in the wedoit4u schema, using the entity beans developed for the tables.

Version:
$Id: DatabaseActionBean.java,v 1.7 2004/05/26 11:42:35 rakesh Exp $
Author:
Rakesh Vidyadharan 21st September 2003

Copyright 2003, wedoit4u.biz

See Also:
Serialized Form

Field Summary
 
Fields inherited from class biz.wedoit4u.ejb.session.SessionBeanAdapter
sessionContext
 
Constructor Summary
DatabaseActionBean()
           
 
Method Summary
 CategoryBean editCategory(int categoryId, int customerId, java.lang.String menuName, java.lang.String longName, java.lang.String brief, java.lang.String picture, java.lang.String description)
          Create/edit a record in the categories table.
 ContentBean editContent(int contentId, int categoryId, java.lang.String title, java.lang.String brief, java.lang.String picture, java.lang.String body)
          Create/edit a record in the contents table.
 CustomerBean editCustomer(int customerId, java.lang.String username, java.lang.String password, java.lang.String email, java.lang.String domain, java.lang.String activeStr, java.lang.String activationDateStr, java.lang.String expirationDateStr, int customerTypeId)
          Create/edit a record in the customers table.
 CustomerTypeBean editCustomerType(int customerTypeId, java.lang.String type, java.lang.String description, int partnerId)
          Create/edit a record in the customer_type table.
 
Methods inherited from class biz.wedoit4u.ejb.session.SessionBeanAdapter
ejbActivate, ejbCreate, ejbPassivate, ejbRemove, setSessionContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseActionBean

public DatabaseActionBean()
Method Detail

editCustomerType

public CustomerTypeBean editCustomerType(int customerTypeId,
                                         java.lang.String type,
                                         java.lang.String description,
                                         int partnerId)
                                  throws javax.ejb.CreateException,
                                         javax.ejb.FinderException,
                                         javax.naming.NamingException
Create/edit a record in the customer_type table.

Parameters:
customerTypeId - - The customer_type_id to use to find the entity bean instance. If this value is 0, then a new record will be added to the database, otherwise, the existing record will be updated with the specified values of type and description.
type - - The type value.
description - - The description value.
partnerId - - The partner_id value.
Returns:
CustomerTypeBean - The new customer_type_id value if a new record was created, or the passed in value.
Throws:
javax.ejb.CreateException - - If exceptions are encountered while creating a new entity bean instance.
javax.ejb.FinderException - - If exceptions are encountered while finding the specified entity bean instance.
javax.naming.NamingException - - If exceptions are encountered while finding the CustomerTypes home interface.
See Also:
CustomerTypeBean, CustomerType, CustomerTypes

editCustomer

public CustomerBean editCustomer(int customerId,
                                 java.lang.String username,
                                 java.lang.String password,
                                 java.lang.String email,
                                 java.lang.String domain,
                                 java.lang.String activeStr,
                                 java.lang.String activationDateStr,
                                 java.lang.String expirationDateStr,
                                 int customerTypeId)
                          throws javax.ejb.CreateException,
                                 javax.ejb.FinderException,
                                 javax.naming.NamingException
Create/edit a record in the customers table.

Parameters:
customerId - - The customer_id to use to find the entity bean instance. If this value is 0, then a new record will be added to the database, otherwise, the existing record will be updated with the specified values of type and description.
username - - The username value.
password - - The password value.
email - - The email value.
domain - - The domain value.
activeStr - - The active value.
activationDateStr - - The activation_date value in SQLTimestamp format (yyyy-mm-dd hh:MM:ss).
expirationDateStr - - The expiration_date value in SQLTimestamp format.
customerTypeId - - The customer_type_id value.
Returns:
CustomerBean - The java bean that represents the record identified by the customer_type_id value.
Throws:
javax.ejb.CreateException - - If exceptions are encountered while creating a new entity bean instance.
javax.ejb.FinderException - - If exceptions are encountered while finding the specified entity bean instance.
javax.naming.NamingException - - If exceptions are encountered while finding the CustomerTypes home interface.
See Also:
CustomerBean, Customer, Customers

editCategory

public CategoryBean editCategory(int categoryId,
                                 int customerId,
                                 java.lang.String menuName,
                                 java.lang.String longName,
                                 java.lang.String brief,
                                 java.lang.String picture,
                                 java.lang.String description)
                          throws javax.ejb.CreateException,
                                 javax.ejb.FinderException,
                                 javax.naming.NamingException
Create/edit a record in the categories table.

Parameters:
categoryId - - The category_id to use to find the entity bean instance. If this value is 0 then a new record will be added to the database, otherwise the existing record will be updated with the specified information.
customerId - - The customer_id value.
menuName - - The menu_name value.
longName - - The long_name value.
brief - - The brief value. This value may be null.
picture - - The picture value. This value may be null.
description - - The description value. This value may be null.
Returns:
CategoryBean - The java bean instance corresponding to the category_id value.
Throws:
javax.ejb.CreateException - - If exceptions are encountered while creating a new entity bean instance.
javax.ejb.FinderException - - If exceptions are encountered while finding the specified entity bean instance.
javax.naming.NamingException - - If exceptions are encountered while finding the Categories home interface.
See Also:
Category

editContent

public ContentBean editContent(int contentId,
                               int categoryId,
                               java.lang.String title,
                               java.lang.String brief,
                               java.lang.String picture,
                               java.lang.String body)
                        throws javax.ejb.CreateException,
                               javax.ejb.FinderException,
                               javax.naming.NamingException
Create/edit a record in the contents table.

Parameters:
contentId - - The content_id to use to find the entity bean instance. If this value is 0 then a new record will be added to the database, otherwise the existing record will be updated with the specified information.
categoryId - - The category_id value.
title - - The title value.
brief - - The brief value. This value may be null.
picture - - The picture value. This value may be null.
body - - The body value. This value may be null.
Returns:
ContentBean - The java bean instance corresponding to the content_id value.
Throws:
javax.ejb.CreateException - - If exceptions are encountered while creating a new entity bean instance.
javax.ejb.FinderException - - If exceptions are encountered while finding the specified entity bean instance.
javax.naming.NamingException - - If exceptions are encountered while finding the Contents home interface.
See Also:
Content

Rakesh API

Copyright © 2002-2005 - Rakesh Vidyadharan