CMP Entity bean and Primary key
CMP Entity bean and Primary key
От:
Habib Seifzadeh <habibseifzadeh@yahoo.com>
Дата:
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>