X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 012BC528E1 for ; Fri, 27 May 2005 17:30:07 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 13564-10 for ; Fri, 27 May 2005 20:30:03 +0000 (GMT) Received: from habib.seif.com.ir (unknown [217.219.1.141]) by svr1.postgresql.org (Postfix) with ESMTP id 9FD36528CC for ; Fri, 27 May 2005 17:29:58 -0300 (ADT) Received: from [127.0.0.1] (habib.seif.com.ir [127.0.0.1]) by habib.seif.com.ir (Postfix) with ESMTP id A1DD4111F03 for ; Sat, 28 May 2005 01:02:06 +0430 (IRDT) Message-ID: <4297836F.4050104@yahoo.com> Date: Sat, 28 May 2005 01:00:39 +0430 From: Habib Seifzadeh User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: CMP Entity bean and Primary key Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=3.924 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, FORGED_YAHOO_RCVD X-Spam-Level: *** X-Archive-Number: 200505/125 X-Sequence-Number: 12956 Hi there, I use NetBeans 4.1EA and J2EE RI. I have no problem with creating CMP Entity beans using Pointbase or MySQL database server but when I want to deploy CMP Entity bean which is mapped to a PostgreSQL table, JCodeGenerator of Application server catches an Exception. Unfortunately, I could find only one message that it's sender have my problem and there was no reasonable reply to that. the message is: > Having a strange problem with Sun studio 4 update 1 talking to postgreSQL > 7.3. (Redhat version) > > Using the latest Postgres JDBC driver (both latest stable and dev > releases)- in Sun studio I'm having problems mapping my container manager > persitence entity beans to postgres tables. > > I make a database schema and entity bean from the postgres datasource > (everything's fine at this stage) but when I try to map > the ejb fields to tables in the postgres schema, for deployment, the > dialogue reports "Table 'x' has no primary keys defined" > > I've checked my keys and indexes and I definitley have a primary key > defined. Is there something I'm missing? > > I have the database in MySQL also and it works fine with Sun - but I'd > much > rather have a postgres backend. > > I've searched the web and newsgroups and can find hardly any information > on > this topic, your help would be very much appreciated > > > regards > Nuno D. Leitao and here is some information about my databse and app: 1. the database name is habib and is in localhost. 2. the table is student and here is it's columns: CREATE TABLE student ( id int2 NOT NULL, name varchar(10), CONSTRAINT student_pkey PRIMARY KEY (id) ) WITH OIDS; ALTER TABLE student OWNER TO habib; of course, I checked WITHOUT OIDS, but the problem remains. 3. here is public_Module1Ejb.dbschema : <_elms> student
<_elms> <_template> <_name> student <_elms> <_unique>false <_name> student_pkey <_elms> <_isNullable>false <_length> 2 <_name> id <_precision> <_type>5 <_scale> 0 <_template> <_template> true <_elms> <_isNullable>true <_length> 10 <_name> name <_precision> <_type>12 <_scale> <_template> <_template> <_name> habib [habib on public] <_driverVersion>PostgreSQL 7.4.5 JDBC3 with SSL (build 216) <_catalog> habib <_databaseProductVersion>7.4.5 <_driver>org.postgresql.Driver <_databaseProductName>PostgreSQL <_schema> public <_url>jdbc:postgresql://localhost:5432/habib <_driverName>PostgreSQL Native Driver <_username>habib 2 4. And finally here is sun-cmp-mappings.xml : public_Module1Ejb Student student id student.id name student.name Please help me, Thank you in advance, Habib