Known problem. I have reported it as bug.

Beware that if you are using jboss, composite PKs are not supported very
well on 3.x versions.

On fre, 2002-05-17 at 14:56, [EMAIL PROTECTED] wrote:
> Hello all,
> 
> I have another problem. I am using generated composite primary keys. They
> may only contain one element though. When XDoclet generates the ejb-jar.xml
> file it is adding the tag <primkey-field> and this is causing problems with
> the container.
> 
> eg:
> 
> IndividualBean.java
> -------------------
> /**
>  * @ejbPrimaryKey <{IndividualPK}>
>  * @ejbTransactionAttribute Required
>  * @stereotype party
>  * @author Stephen J. Thompson
>  * @undefined
>  * @displayName
>  * @ejbLocal <{IndividualLocal}>
>  * @ejbLocalHome <{IndividualLocalHome}>
>  *
>  *
>  * @ejb:bean      name="IndividualBean"
>  *                type="CMP"
>  *                view-type="local"
>  *                local-jndi-name="ejb/cass/contactmanager/IndividualLocal"
>  *                primkey-field="uid"
>  *
>  * @ejb:home      extends="javax.ejb.EJBHome"
>  *                generate="local"
>  *
> local-class="uk.co.cass_ltd.contactmanager.dataobject.IndividualLocalHome"
>  *
>  * @ejb:interface extends="javax.ejb.EJBObject"
>  *                generate="local"
>  *
> local-class="uk.co.cass_ltd.contactmanager.dataobject.IndividualLocal"
>  *
>  * @ejb:pk
> class="uk.co.cass_ltd.contactmanager.dataobject.IndividualPK"
>  *
>  *
>  * @jboss:table-name     "CASSINDIVIDUAL"
>  * @jboss:create-table   "true"
>  * @jboss:remove-table   "false"
>  * @jboss:tuned-updates  "true"
>  * @jboss:read-only      "false"
>  */
> abstract public class IndividualBean implements EntityBean {
> ...
>     /**
>      * @undefined
>      * @ejbColumnName UID
>      *
>      *
>      * @ejb:pk-field
>      * @ejb:persistent-field
>      * @ejb:interface-method
>      *
>      * @jboss:column-name "UID"
>      */
>     public abstract Integer getUid() throws javax.ejb.EJBException;
> 
>     public abstract void setUid(Integer param) throws EJBException;
> ...
> }
> 
> 
> 
> 
> 
> 
> 
> 
> IndividualPK.java
> -----------------
> /**
>  * Primary key for IndividualBean.
>  * @ejbPrimaryKey <{IndividualPK}>
> 
>  * @ejbTransactionAttribute Required
> 
>  * @stereotype party
> 
>  * @author XDOCLET 1.1.2
>  * @undefined 
> 
>  * @displayName 
> 
>  * @ejbLocal <{IndividualLocal}>
> 
>  * @ejbLocalHome <{IndividualLocalHome}>
> 
>  * @xdoclet-generated at 17-May-02 11:49:49
>  */
> public class IndividualPK
>    extends java.lang.Object
>    implements java.io.Serializable
> {
>    static final long serialVersionUID = -3539616133369563807L;
>    transient private int _hashCode = Integer.MIN_VALUE;
>    transient private String value = null;
> 
>    public java.lang.Integer uid;
> 
>    public IndividualPK()
>    {
>    }
> 
>    public IndividualPK( java.lang.Integer uid )
>    {
>       this.uid = uid;
>    }
> 
>    public java.lang.Integer getUid()
>    {
>       return uid;
>    }
> 
>    public void setUid(java.lang.Integer uid)
>    {
>       this.uid = uid;
>    }
> 
>    public int hashCode()
>    {
>       if( _hashCode == Integer.MIN_VALUE )
>       {
>          _hashCode += this.uid.hashCode();
>       }
> 
>       return _hashCode;
>    }
> 
>    public boolean equals(Object obj)
>    {
>       if( !(obj instanceof
> uk.co.cass_ltd.contactmanager.dataobject.IndividualPK) )
>          return false;
> 
>       uk.co.cass_ltd.contactmanager.dataobject.IndividualPK pk =
> (uk.co.cass_ltd.contactmanager.dataobject.IndividualPK)obj;
>       boolean eq = true;
> 
>       if( obj == null )
>       {
>          eq = false;
>       }
>       else
>       {
>          if( this.uid == null &&
> ((uk.co.cass_ltd.contactmanager.dataobject.IndividualPK)obj).getUid() ==
> null )
>          {
>             eq = true;
>          }
>          else
>          {
>             if( this.uid == null ||
> ((uk.co.cass_ltd.contactmanager.dataobject.IndividualPK)obj).getUid() ==
> null )
>             {
>                eq = false;
>             }
>             else
>             {
>                eq = eq && this.uid.equals( pk.uid );
>             }
>          }
>       }
> 
>       return eq;
>    }
> 
>    public String toString()
>    {
>       if( value == null )
>       {
>          value = "[.";
>          value += this.uid+".";
>          value += "]";
>       }
> 
>       return value;
>    }
> }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ejb-jar.xml - generated by XDoclet.
> -----------------------------------
> 
> ...
>       <entity >
>          <description><![CDATA[No Description.]]></description>
> 
>          <ejb-name>IndividualBean</ejb-name>
> 
>  
> <local-home>uk.co.cass_ltd.contactmanager.dataobject.IndividualLocalHome</lo
> cal-home>
>  
> <local>uk.co.cass_ltd.contactmanager.dataobject.IndividualLocal</local>
> 
>  
> <ejb-class>uk.co.cass_ltd.contactmanager.dataobject.IndividualBean</ejb-clas
> s>
>          <persistence-type>Container</persistence-type>
>  
> <prim-key-class>uk.co.cass_ltd.contactmanager.dataobject.IndividualPK</prim-
> key-class>
>          <reentrant>False</reentrant>
>          <cmp-version>2.x</cmp-version>
>          <abstract-schema-name>IndividualBean</abstract-schema-name>
>          <cmp-field >
>             <description><![CDATA[]]></description>
>             <field-name>uid</field-name>
>          </cmp-field>
>          <cmp-field >
>             <description><![CDATA[]]></description>
>             <field-name>dear</field-name>
>          </cmp-field>
>          <cmp-field >
>             <description><![CDATA[]]></description>
>             <field-name>forname</field-name>
>          </cmp-field>
>          <cmp-field >
>             <description><![CDATA[]]></description>
>             <field-name>middlename</field-name>
>          </cmp-field>
>          <cmp-field >
>             <description><![CDATA[]]></description>
>             <field-name>surname</field-name>
>          </cmp-field>
>          <primkey-field>uid</primkey-field>
> 
>       </entity>
> ...
> 
> 
> As you can see it added the tag <primkey-field>uid</primkey-field> to the
> ejb-jar.xml file. This causes JBoss to reject it with the message "The type
> of primkey-field must match the primary key class". If I delete the line
> from the ejb-jar.xml file it deploys fine.
> 
> 
> Anyone know where I have gone wrong?
> 
> 
> Thanks.
> 
> 
> Stephen.
> 
> 
> ---
> Tell someone there are 100 billion stars and they will believe you...
> Tell them that a bench has wet paint on it and they'll have to touch it to 
> be sure. 
> 
> 
> 
>-------------------------------------------------------------------------------------------
> 
> Copyright material and/or confidential and/or privileged information may be 
>contained in this e-mail and any attached documents.  The material and information is 
>intended for the use of the intended addressee only.  If you are not the intended 
>addressee, or the person responsible for delivering it to the intended addressee, you 
>may not copy, disclose, distribute, disseminate or deliver it to anyone else or use 
>it in any unauthorised manner or take or omit to take any action in reliance on it. 
>To do so is prohibited and may be unlawful.   The views expressed in this e-mail may 
>not be official policy but the personal views of the originator.  If you receive this 
>e-mail in error, please advise the sender immediately by using the reply facility in 
>your e-mail software, or contact [EMAIL PROTECTED]  Please also delete this 
>e-mail and all documents attached immediately.  
> Many thanks for your co-operation.
> 
> BMW Financial Services (GB) Limited is registered in England and Wales under company 
>number 01288537.
> Registered Offices : Europa House, Bartley Way, Hook, Hants, RG27 9UF
> 
>------------------------------------------------------------------------------------------
> 
> 
> _______________________________________________
> Xdoclet-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/xdoclet-user



_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
_______________________________________________
Xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to