From: Dmitri C. <di...@bi...> - 2001-10-30 22:54:19
|
Ok - from your previous email, you said you've removed your class=Integer instruction from @ejb:pk. So I'm guessing that you now have a ReportPK class being generated. I also assume that your create method signatures look like: public ReportPK ejbCreate(...) throws ... > But now I get this warning from JBoss when deploying: > Bean : Report > Section: 9.4.7.1 > Warning: The type of the field named in the primkey-field element must match > the > class in the prim-key-class element. > > But I guess it's just a warning... Whenever you get warnings from JBoss , and they quote a spec section (9.4.7.1), go and look that part of the spec up. In this case, its says: * 9.4.7.1 Primary key that maps to a single field in the entity bean class The Bean Provider uses the primkey-field element of the deployment descriptor to specify the container-managed field of the entity bean class that contains the primary key. The fields type must be the primary key type. There are two types of primary keys - single fields (covered by 9.4.7.1), or multiple fields (covered by 9.4.7.2). In your case, you are effectively following multiple fields, even though you only have one field in your pk. multiple fields should really say "custom pk classes" or something like that (imho). In short - something is still wrong. From what I gather you must have both an prim-key-class and primkey-field. From the dtd: The primkey-field element is not used if the primary key maps to multiple container-managed fields (i.e. the key is a compound key). In this case, the fields of the primary key class must be public, and their names must correspond to the field names of the entity bean class that comprise the key. so something is causing XDoclet to include both - in you ejb:bean do you have a primkey-field property? if so, remove it... anyway, longwinded explanation there, but should fix your problem (o: cheers dim |