📄 accountbean.java
字号:
/*
* Created on 2004-6-19
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Generation - Code and Comments
*/
package com.j2ee14.ch17;
import javax.ejb.EntityBean;
/**
* @ejb.bean name="Account"
* jndi-name="ejb/AccountBeanRemote"
* type="CMP"
* primkey-field="userId"
* schema="test"
* cmp-version="2.x"
*
*--
* This is needed for JOnAS.
* If you are not using JOnAS you can safely remove the tags below.
* @jonas.bean ejb-name="Account"
* jndi-name="AccountBean"
* @jonas.jdbc-mapping jndi-name="jdbc/account" jdbc-table-name="Account"
* --
*
* @ejb.persistence
* table-name="Account"
*
* @ejb.finder
* query="SELECT OBJECT(a) FROM test as a"
* signature="java.util.Collection findAll()"
*
*--
* This is needed for JOnAS.
* If you are not using JOnAS you can safely remove the tags below.
* @jonas.finder-method-jdbc-mapping method-name="findAll"
* jdbc-where-clause=""
* @jonas.jdbc-mapping jndi-name="jdbc/account"
* jdbc-table-name="Account"
*
*--
*
**/
public abstract class AccountBean implements EntityBean {
/**
* The ejbCreate method.
*
* @ejb.create-method
*/
public java.lang.String ejbCreate(String userId)
throws javax.ejb.CreateException {
// EJB 2.0 spec says return null for CMP ejbCreate methods.
// TODO: YOU MUST INITIALIZE THE FIELDS FOR THE BEAN HERE.
// setMyField("Something");
setUserId(userId);
return null;
}
/**
* The container invokes this method immediately after it calls ejbCreate.
*
*/
public void ejbPostCreate(String userid) throws javax.ejb.CreateException {
}
/**
* Returns the userId
* @return the userId
*
* @ejb.persistent-field
* @ejb.persistence
* column-name="userId"
* sql-type="varchar"
* @ejb.pk-field
* @ejb.interface-method
*
* --
* This is needed for JOnAS.
* If you are not using JOnAS you can safely remove the tags below.
* @jonas.cmp-field-jdbc-mapping field-name="userId"
* jdbc-field-name="userId"
*
--
*/
public abstract java.lang.String getUserId();
/**
* Sets the userId
*
* @param java.lang.String the new userId value
*
* @ejb.interface-method
*/
public abstract void setUserId(java.lang.String userId);
/**
* Returns the trueName
* @return the trueName
*
* @ejb.persistent-field
* @ejb.persistence
* column-name="trueName"
* sql-type="varchar"
*
* @ejb.interface-method
*
* --
* This is needed for JOnAS.
* If you are not using JOnAS you can safely remove the tags below.
* @jonas.cmp-field-jdbc-mapping field-name="trueName"
* jdbc-field-name="trueName"
*
--
*/
public abstract java.lang.String getTrueName();
/**
* Sets the trueName
*
* @param java.lang.String the new trueName value
*
* @ejb.interface-method
*/
public abstract void setTrueName(java.lang.String trueName);
/**
* Returns the sex
* @return the sex
*
* @ejb.persistent-field
* @ejb.persistence
* column-name="sex"
* sql-type="varchar"
*
* @ejb.interface-method
*
* --
* This is needed for JOnAS.
* If you are not using JOnAS you can safely remove the tags below.
* @jonas.cmp-field-jdbc-mapping field-name="sex"
* jdbc-field-name="sex"
*
--
*/
public abstract java.lang.String getSex();
/**
* Sets the sex
*
* @param java.lang.String the new sex value
*
* @ejb.interface-method
*/
public abstract void setSex(java.lang.String sex);
/**
* Returns the address
* @return the address
*
* @ejb.persistent-field
* @ejb.persistence
* column-name="address"
* sql-type="blob"
*
* @ejb.interface-method
*
* --
* This is needed for JOnAS.
* If you are not using JOnAS you can safely remove the tags below.
* @jonas.cmp-field-jdbc-mapping field-name="address"
* jdbc-field-name="address"
*
--
*/
public abstract Address getAddress();
/**
* Sets the address
*
* @param java.lang.String the new address value
*
* @ejb.interface-method
*/
public abstract void setAddress(Address address);
/**
* Returns the password
* @return the password
*
* @ejb.persistent-field
* @ejb.persistence
* column-name="password"
* sql-type="varchar"
*
* @ejb.interface-method
*
* --
* This is needed for JOnAS.
* If you are not using JOnAS you can safely remove the tags below.
* @jonas.cmp-field-jdbc-mapping field-name="password"
* jdbc-field-name="password"
*
--
*/
public abstract java.lang.String getPassword();
/**
* Sets the password
*
* @param java.lang.String the new password value
*
* @ejb.interface-method
*/
public abstract void setPassword(java.lang.String password);
/**
* Returns the age
* @return the age
*
* @ejb.persistent-field
* @ejb.persistence
* column-name="age"
* sql-type="int"
*
* @ejb.interface-method
*
* --
* This is needed for JOnAS.
* If you are not using JOnAS you can safely remove the tags below.
* @jonas.cmp-field-jdbc-mapping field-name="age"
* jdbc-field-name="age"
*
--
*/
public abstract int getAge();
/**
* Sets the age
*
* @param int the new age value
*
* @ejb.interface-method
*/
public abstract void setAge(int age);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -