📄 useraccountbean.java
字号:
/*
* @author : Umesh Kulkarni
* @version 1.0
*
* Development Environment : Oracle9i JDeveloper
*
* Name of the File : UserAccountBean.java
*
* Creation / Modification History
* Umesh 26-Apr-2002 Created
*
*/
package oracle.otnsamples.ibfbs.usermanagement.ejb;
import javax.ejb.EntityContext;
import java.util.Collection;
/**
* This Class acts as Bean Implementation for UserAccountBean which is a local
* EJB Object. Every User Account can have multiple Alerts, Preferences,
* Portfolio, Trade Details and this 1:N relationship is managed by the
* OC4J EJB Container.
*
* This new feature called CMR (Container Managed RelationShips) is a new
* feature added in EJB 2.0 Specification.
*
* Note that A) This class is defined as abstract as Container actually
* implements most of the logic for managing relationships (CMRs) and
* Persisting Fields(CMPs).
* This feature of CMR is added in EJB 2.0 Specification.
*
* B) This Class also does not declare the instance variables such as
* AccountNumber, Symbol etc. In earlier approach EJB 1.1, the entity bean
* used to declare the instance variables mapping to variables in the
* Entity object. This was removed in EJB 2.0 Specification.
* @version 1.0
* @since 1.0
*/
public abstract class UserAccountBean
implements javax.ejb.EntityBean {
// implements javax.ejb.EntityBean, TimedObject {
private EntityContext ectx;
// private InitialContext ictx;
/**
* Method to create UserAccountBean Local EJB Object.
*
* @param accountNumber Account Number of the User Account
* @param password Password associated with the User Account
* @param firstName First Name associated with the User Account
* @param lastName Last Name associated with the User Account
* @param organization Organization associated with the User Account
* @param address Address associated with the User Account
* @param city City associated with the User Account
* @param country Country associated with the User Account
* @param phone Phone Number associated with the User Account
* @param accountBalance Account Balance associated with User Account
* @param email Email Value associated with the User Account
* @param userType User Type associated with the User Account
* @param linesPerPage Lines Per Page associated with User Account
* @param alertMode Alert Mode associated with the User Account
* @param mobileEmail Mobile Email associated with the User Account
* @return Local EJB Object implementing UserAccountLocal interface
* @since 1.0
*/
public Integer ejbCreate(Integer accountNumber, String password,
String firstName, String lastName,
String organization, String address,
String city, String state, String country,
String phone, float accountBalance, String email,
String userType, Integer linesPerPage,
String alertMode, String mobileEmail) {
// Invoke Appropriate Setter Methods to initialize the values.
// Note that the implementation of these setter methods are provided
// by EJB Container as these fields are CMP
setAccountNumber(accountNumber);
setPassword(password);
setFirstName(firstName);
setLastName(lastName);
setOrganization(organization);
setAddress(address);
setCity(city);
setState(state);
setCountry(country);
setPhone(phone);
setAccountBalance(accountBalance);
setEmail(email);
setUserType(userType);
setLinesPerPage(linesPerPage);
setAlertMode(alertMode);
setMobileEmail(mobileEmail);
return null;
}
/**
* Method which is called by the Container after invoking of ejbCreate().
* This method has the same signature as ejbCreate() method.
* @param accountNumber Account Number of the User Account
* @param password Password associated with the User Account
* @param firstName First Name associated with the User Account
* @param lastName Last Name associated with the User Account
* @param organization Organization associated with the User Account
* @param address Address associated with the User Account
* @param city City associated with the User Account
* @param country Country associated with the User Account
* @param phone Phone Number associated with the User Account
* @param accountBalance Account Balance associated with User Account
* @param email Email Value associated with the User Account
* @param userType User Type associated with the User Account
* @param linesPerPage Lines Per Page associated with User Account
* @param alertMode Alert Mode associated with the User Account
* @param mobileEmail Mobile Email associated with the User Account
* @since 1.0
*/
public void ejbPostCreate(Integer accountNumber, String password,
String firstname, String lastname,
String organization, String address,
String city, String state, String country,
String phone, float accountBalance, String email,
String userType, Integer linesPerPage,
String alertMode, String mobileEmail) {}
/**
* Method Declarations for implementing Persistent CMR relationships
* Method implementations are provided by the EJB Container.
*/
/**
* Method to get all the Alerts for this User Account.
* Note that there are multiple Alerts for a User Account and return value
* is a collection of 'AlertsLocal'
*
* @return All Alerts Associated with the User Account.
* @since 1.0
*/
public abstract Collection getAlerts();
/**
* Method to set all the Alerts for this User Account.
* Note that there are multiple Alerts for a User Account and input value
* is a collection of 'AlertsLocal'
*
* @param alerts All Alerts Associated with the User Account.
* @since 1.0
*/
public abstract void setAlerts(Collection alerts);
/**
* Method to get all the preferences for this User Account.
* Note that there are multiple Preferences for a User Account and return
* value is a collection of 'PreferencesLocal'
*
* @return All Preferences Associated with the User Account.
* @since 1.0
*/
public abstract Collection getPreferences();
/**
* Method to set all the preferences for this User Account.
* Note that there are multiple Preferences for a User Account and input
* value is a collection of 'PreferencesLocal'
*
* @param preferences All Preferences Associated with the User Account.
* @since 1.0
*/
public abstract void setPreferences(Collection preferences);
/**
* Method to get all the Portfolio Records for this User Account.
* Note that there are multiple portfolio records for a User Account and
* return value is a collection of 'PortfolioLocal'
*
* @return All Portfolio records Associated with the User Account.
* @since 1.0
*/
public abstract Collection getPortfolio();
/**
* Method to set all the portfolio for this User Account.
* Note that there are multiple portfolio records for a User Account and
* input value is a collection of 'PortfolioLocal'
*
* @param portfolio All Portfolio Associated with the User Account.
* @since 1.0
*/
public abstract void setPortfolio(Collection portfolio);
/**
* Method to get all the Trade Details records for this User Account.
* Note that there are multiple Trade Details Records for a User Account
* and return value is a collection of 'TradeDetailsLocal'
*
* @return All Trade Detail Records Associated with the User Account.
* @since 1.0
*/
public abstract Collection getTradeDetails();
/**
* Method to set all the Trade Details Records for this User Account.
* Note that there are multiple Trade Details Records for a User Account
* and input value is a collection of 'PortfolioLocal'
*
* @param tradeDetails All Trade Details Records Associated with
* the User Account.
* @since 1.0
*/
public abstract void setTradeDetails(Collection tradeDetails);
/**
* Abstract Methods for CMP Fields.
* Method implementations are provided by the EJB Container.
*/
/**
* Method to retrieve the value of AccountNumber associated
* with the User Account
*
* @return The Desired Account Number Value
* @since 1.0
*/
public abstract Integer getAccountNumber();
/**
* Method to assign the new AccountNumber value in the User Account.
*
* @param accountNumber New Account Number Value
* @since 1.0
*/
public abstract void setAccountNumber(Integer accountNumber);
/**
* Method to retrieve the value of Password associated with the User Account
*
* @return The Desired Password Value
* @since 1.0
*/
public abstract String getPassword();
/**
* Method to assign the new Password value in the User Account.
*
* @param password New Password Value
* @since 1.0
*/
public abstract void setPassword(String password);
/**
* Method to retrieve the value of First Name associated with the User Account
*
* @return The Desired First Name Value
* @since 1.0
*/
public abstract String getFirstName();
/**
* Method to assign the new First Name value in the User Account.
*
* @param firstName New First Name Value
* @since 1.0
*/
public abstract void setFirstName(String firstName);
/**
* Method to retrieve the value of Last Name associated with the User Account
*
* @return The Desired Last Name Value
* @since 1.0
*/
public abstract String getLastName();
/**
* Method to assign the new Last Name value in the User Account.
*
* @param lastName New Last Name Value
* @since 1.0
*/
public abstract void setLastName(String lastName);
/**
* Method to assign the new Organization value in the User Account.
* @since 1.0
*/
public abstract String getOrganization();
/**
* Method to retrieve the value of Address associated with the User Account
*
* @param organization New Organization Value
* @since 1.0
*/
public abstract void setOrganization(String organization);
/**
* Method to retrieve the value of Address associated with the User Account
*
* @return The Desired Address Value
* @since 1.0
*/
public abstract String getAddress();
/**
* Method to assign the new Address value in the User Account.
*
* @param address New Address Value
* @since 1.0
*/
public abstract void setAddress(String address);
/**
* Method to retrieve the value of City associated with the User Account
*
* @return The Desired City Value
* @since 1.0
*/
public abstract String getCity();
/**
* Method to assign the new City value in the User Account.
*
* @param city New City Value
* @since 1.0
*/
public abstract void setCity(String city);
/**
* Method to retrieve the value of State associated with the User Account
*
* @return The Desired State Value
* @since 1.0
*/
public abstract String getState();
/**
* Method to assign the new State value in the User Account.
*
* @param state New State Value
* @since 1.0
*/
public abstract void setState(String state);
/**
* Method to retrieve the value of Country associated with the User Account
*
* @return The Desired Country Value
* @since 1.0
*/
public abstract String getCountry();
/**
* Method to assign the new country value in the User Account.
*
* @param country New Country Value
* @since 1.0
*/
public abstract void setCountry(String country);
/**
* Method to retrieve the value of Phone associated with the User Account
*
* @return The Desired Phone Value
* @since 1.0
*/
public abstract String getPhone();
/**
* Method to assign the new Phone value in the User Account.
*
* @param phone New Phone Value
* @since 1.0
*/
public abstract void setPhone(String phone);
/**
* Method to retrieve the value of AccountBalance associated with the User Account
*
* @return The Desired AccountBalance Value
* @since 1.0
*/
public abstract float getAccountBalance();
/**
* Method to assign the new AccountBalance value in the User Account.
*
* @param accountBalance New Account Balance Value
* @since 1.0
*/
public abstract void setAccountBalance(float accountBalance);
/**
* Method to retrieve the value of Email associated with the User Account
*
* @return The Desired Email Value
* @since 1.0
*/
public abstract String getEmail();
/**
* Method to assign the new Email value in the User Account.
*
* @param email New Email Value
* @since 1.0
*/
public abstract void setEmail(String email);
/**
* Method to retrieve the value of UserType associated with the User Account
*
* @return The Desired User Type Value
* @since 1.0
*/
public abstract String getUserType();
/**
* Method to assign the new UserType value in the User Account.
*
* @param userType New User Type Value
* @since 1.0
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -