Rakesh API

biz.wedoit4u.ejb.session
Interface DatabaseAction

All Superinterfaces:
javax.ejb.EJBLocalObject

public interface DatabaseAction
extends javax.ejb.EJBLocalObject

This stateless session bean provides methods that deal with adding or modifying data in the wedoit4u database. This allows us to ensure that the entity beans are deployed only as local interfaces and are insulated from all presentation logic.

The following code sample shows one way of using the methods in this session bean:

    String customerTypeId = request.getParameter( "customerTypeId" );
    String type = request.getParameter( "type" );
    String description = request.getParameter( "description" );
    try
    {
      DatabaseAction df = SessionBeanProvider.getDatabaseAction();
      int customerTypeId = df.editCustomerType( Integer.parseInt( customerTypeId ), type, description );
    }
    catch ( Exception ex )
    {
      // Do error processing.
    }
 

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

Copyright 2003, wedoit4u.biz

See Also:
SessionBeanProvider.getDatabaseAction()

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 active, java.lang.String activationDate, java.lang.String expirationDate, 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_types table.
 
Methods inherited from interface javax.ejb.EJBLocalObject
getEJBLocalHome, getPrimaryKey, isIdentical, remove
 

Method Detail

editCustomerType

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_types 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 - A java bean that represents the record identified by the 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:
CustomerType

editCustomer

CustomerBean editCustomer(int customerId,
                          java.lang.String username,
                          java.lang.String password,
                          java.lang.String email,
                          java.lang.String domain,
                          java.lang.String active,
                          java.lang.String activationDate,
                          java.lang.String expirationDate,
                          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.
active - - The active value.
activationDate - - The activation_date value in SQLTimestamp (yyyy-mm-dd hh:MM:ss) format.
expirationDate - - The expiration_date value in SQLTimestamp (yyyy-mm-dd hh:MM:ss) format.
customerTypeId - - The customer_type_id value.
Returns:
CustomerBean - The java bean that represents the record with 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:
Customer

editCategory

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

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