急问banq;长整形的问题

04-03-07 daben
我的数据库是oracle,其中一个实体bean是khxx(客户信息),主键是id,

id的字段 number(20).

生成的实体bean中主键类是id:

ejb-jar.xml:

<description>Entity Bean ( CMP )</description>

<display-name>Khxx</display-name>

<ejb-name>Khxx</ejb-name>

<home>daben.KhxxHome</home>

<remote>daben.Khxx</remote>

<ejb-class>daben.impl.KhxxBean</ejb-class>

<persistence-type>Container</persistence-type>

<prim-key-class>java.lang.Long</prim-key-class>

<reentrant>False</reentrant>

<cmp-version>2.x</cmp-version>

<abstract-schema-name>Khxx</abstract-schema-name>

<cmp-field>

<field-name>id</field-name>

</cmp-field>

<cmp-field>

<field-name>khmc</field-name>

</cmp-field>

<cmp-field>

<field-name>khjm</field-name>

</cmp-field>

<cmp-field>

<field-name>khlxr</field-name>

</cmp-field>

<cmp-field>

<field-name>khdz</field-name>

</cmp-field>

<cmp-field>

<field-name>sfhd</field-name>

</cmp-field>

<cmp-field>

<field-name>jsfs</field-name>

</cmp-field>

<cmp-field>

<field-name>jshb</field-name>

</cmp-field>

<cmp-field>

<field-name>chsh</field-name>

</cmp-field>

<cmp-field>

<field-name>dzyj</field-name>

</cmp-field>

<cmp-field>

<field-name>dh</field-name>

</cmp-field>

<cmp-field>

<field-name>yhzh</field-name>

</cmp-field>

<primkey-field>id</primkey-field>

怎么在测试的时候,khxx=khxxHome.findByPrimaryKey(1);

总提示;Error(53,15): method findByPrimaryKey(int) not found in interface daben.KhxxHome

难道int和long还有什么不同?

khxx = khxxHome.create(1,"武汉红进龙","daben","","","","","","","",10000000,10000000);也是提示int的问题。

而在oracle中是可以插入的。

谢谢

oldma
2004-03-08 16:19
khxx=khxxHome.findByPrimaryKey(1L);

猜你喜欢