Is this generated by JBossCMP for MySql?
I would guess that in fact it is for Hypersonic. In this case you should set 
pk-constraint to false. Because, Hypersonic does not allow IDENTITY and explicit 
primary key constraint at the same time.

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of 
> [EMAIL PROTECTED]
> Sent: Wednesday, March 31, 2004 6:19 PM
> To: [EMAIL PROTECTED]
> Subject: [JBoss-user] unknown-pk won't work...
> 
> Hi folks, 
> 
> I'm trying to get an CMP EntityBean startet that should have 
> an auto-generated primary-key, an auto-incremented Integer. 
> After searching quite a long time for information about this, 
> I found only little. And it's not working.
> JBoss tells about a thrown SQLException: Attempt to define a 
> second primary key in statement [CREATE TABLE EMPLOYEE 
> (firstname VARCHAR(256), lastname VARCHAR(256), employeeid 
> INTEGER(11) NOT NULL IDENTITY, CONSTRAINT PK_EMPLOYEE PRIMARY 
> KEY (employeeid))]
> 
> I'd strongly apreciate some help, or maybe even some 
> links/books/whatever where I can get more information. 
> 
> I'm working with Eclipse 2.1.3; JBoss 3.2.3; MySQL 4.0.18 and 
> XDoclet. 
> Here are my XMLs... 
> 
> Thanks in advance for your help. 
> Karsten 
> 
> ejb-jar.xml:
> 
>       <entity >
>          <description><![CDATA[The Employee Entity Bean saves 
> every Employee.]]></description>
>          <display-name>EB_Employee</display-name>
>          <ejb-name>Employee</ejb-name>
>          
> <local-home>medsched.entity.employee.EmployeeLocalHome</local-home>
>          <local>medsched.entity.employee.EmployeeLocal</local>
>          <ejb-class>medsched.entity.employee.EmployeeBean</ejb-class>
>          <persistence-type>Container</persistence-type>
>          <prim-key-class>java.lang.Object</prim-key-class>
>          <reentrant>false</reentrant>
>          <cmp-version>2.x</cmp-version>
>          <abstract-schema-name>Employee</abstract-schema-name>
>          <cmp-field >
>             <field-name>firstname</field-name>
>          </cmp-field>
>          <cmp-field >
>             <field-name>lastname</field-name>
>          </cmp-field>
>          <cmp-field >
>             <field-name>telephone</field-name>
>          </cmp-field>
>       </entity>
>       
>  
> 
> 
> jbosscmp-jdbc.xml: 
> 
>       <entity>
>          <ejb-name>Employee</ejb-name>
>          <create-table>true</create-table>
>          <remove-table>true</remove-table>
>          <cmp-field>
>             <field-name>firstname</field-name>
>             <column-name>firstname</column-name>
>         </cmp-field>
>          <cmp-field>
>             <field-name>lastname</field-name>
>             <column-name>lastname</column-name>
>         </cmp-field>
>          <cmp-field>
>             <field-name>telephone</field-name>
>             <column-name>telephone</column-name>
>         </cmp-field>
>       <unknown-pk>
>               <unknown-pk-class>java.lang.Integer</unknown-pk-class>
>               <field-name>employeeID</field-name>
>               <read-only>true</read-only>
>               <column-name>employeeid</column-name>
>               <auto-increment/>
>       </unknown-pk>
>       </entity>
>       
>  
> 
> -- 
> +++ NEU bei GMX und erstmalig in Deutschland: TÜV-geprüfter 
> Virenschutz 
> +++ +++
> 100% Virenerkennung nach Wildlist. Infos: 
> http://www.gmx.net/virenschutz
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials Free 
> Linux tutorial presented by Daniel Robbins, President and CEO 
> of GenToo technologies. Learn everything from fundamentals to 
> system 
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
> 
> 


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to