马上运行是不可能的,至少要修改JDBC等资源的JNDI名才可以:以下主键实现类:
-----------------------------------------------------
package examples;import java.io.Serializable;public class AccountPK implements java.io.Serializable
{
public String accountID; public AccountPK(String id)
{
this.accountID = id;
} public AccountPK()
{
} public String toString()
{
return accountID;
} public int hashCode()
{
return accountID.hashCode();
}
public boolean equals(Object account)
{
return ((AccountPK)account).accountID.equals(accountID);
}
}
-----------------------------------------------------
package examples;import java.io.Serializable;public class AccountPK implements java.io.Serializable
{
public String accountID; public AccountPK(String id)
{
this.accountID = id;
} public AccountPK()
{
} public String toString()
{
return accountID;
} public int hashCode()
{
return accountID.hashCode();
}
public boolean equals(Object account)
{
return ((AccountPK)account).accountID.equals(accountID);
}
}
解决方案 »
- 如何在Listener或servlet中,使用 spring 使用注解定义的bean?
- 请java高手帮忙,找找什么问题啊!
- 新增数据的时候。它的主键怎么生成啊。。
- 有懂sales force的吗
- 在一个JavaBean中调用另外一个JavaBean的问题
- 请问:谁有jsp+struts+hibernate做的分页源代码?急!!!!!!
- RMI调用,基本需要实现哪几个类?
- 在对一个订单表保存时候出了一个异常·请帮忙看一下
- XML Notepad在什么地方下载?
- 用Java Applet 进行Web编程时,如何限制输入域中可输入字符的长度!解决后马上给分!!!
- 高分酬谢!!ejb.....???? 请多关注--
- 在JB8里建立数据源时出现警告:weblogic\jdbc\JDBCTextTextFormatter
-----------------------------------------------------------------------------
package examples;import javax.ejb.*;
import java.util.Collection;
import java.rmi.RemoteException;public interface AccountHome extends EJBHome
{ Account create(String accountID, String ownerName) throws CreateException, RemoteException; public Account findByPrimaryKey(AccountPK key) throws FinderException, RemoteException; public Collection findByOwnerName(String name) throws FinderException, RemoteException; public double getTotalBankValue() throws AccountException, RemoteException;}
----------------------------------------------------------------------
package examples;import javax.ejb.*;
import java.rmi.RemoteException;public interface Account extends EJBObject
{ public void deposit(double amt) throws AccountException, RemoteException;
public void withdraw(double amt) throws AccountException, RemoteException;
public double getBalance() throws RemoteException; public String getOwnerName() throws RemoteException;
public void setOwnerName(String name) throws RemoteException; public String getAccountID() throws RemoteException;
public void setAccountID(String id) throws RemoteException;
}