weblogic+oracle中关于自增列的问题
weblogic+oracle中关于自增列的问题
1__address表格自增列为id
2__数据库中有个TABLE ADDRESS_SEQUENCE (SEQUENCE int NOT NULL );插入了纪录100
3___ <automatic-key-generation>
<generator-type>ORACLE</generator-type>
<generator-name>ADDRESS_SEQUENCE</generator-name>
<key-cache-size>10</key-cache-size>
</automatic-key-generation>
4_运行插入测试程序,
addr = addrHome.createAddress(street, city, state, zip);
发现address 的 ejbCreateAddress进行到setZip(zip);以后没有了反映,数据插入失败,为什么??
addressbean代码如下
import javax.ejb.*;
abstract public class AddressBean implements EntityBean {
EntityContext entityContext;
public Integer ejbCreateAddress(String street, String city, String state, String zip) throws
CreateException {
setStreet(street);
setCity(city);
setState(state);
setZip(zip);
return null;
}
public void ejbPostCreateAddress(String street, String city, String state, String zip) throws
CreateException {
/**@todo Complete this method*/
}
public void ejbRemove() throws RemoveException {
/**@todo Complete this method*/
}
public abstract void setId(Integer id);
public abstract void setStreet(String street);
public abstract void setCity(String city);
public abstract void setState(java.lang.String state);
public abstract void setZip(java.lang.String zip);
public abstract Integer getId();
public abstract String getStreet();
public abstract String getCity();
public abstract java.lang.String getState();
public abstract java.lang.String getZip();
public void ejbLoad() {
/**@todo Complete this method*/
}
public void ejbStore() {
/**@todo Complete this method*/
}
public void ejbActivate() {
/**@todo Complete this method*/
}
public void ejbPassivate() {
/**@todo Complete this method*/
}
public void unsetEntityContext() {
this.entityContext = null;
}
public void setEntityContext(EntityContext entityContext) {
this.entityContext = entityContext;
}
}