persistence@glassfish.java.net

RES: TopLink and PostGreSQL exception: please I need help

From: Alea Management & Technology Solutions <ti_at_alea.inf.br>
Date: Mon, 26 May 2008 19:38:49 -0300

Christopher,

The table creation inside Postgre was
designed using the following syntax:

CREATE TABLE "TVDACAD001"
(
  "IDCLI" numeric(10) NOT NULL,
  "IDGRC" character(4),
  CONSTRAINT "TVDACAD001_PK" PRIMARY KEY ("IDCLI")
)
WITH (OIDS=FALSE);
ALTER TABLE "TVDACAD001" OWNER TO postgres;

I will delimit the @Table annotation as you said
and let you know if everything is fine.

Best Regards,

Lee Andrew
-----Mensagem original-----
De: christopher delahunt [mailto:christopher.delahunt_at_oracle.com]
Enviada em: segunda-feira, 26 de maio de 2008 19:07
Para: ti_at_alea.inf.br
Cc: persistence_at_glassfish.dev.java.net
Assunto: Re: TopLink and PostGreSQL exception: please I need help

Hello Lee,

PostgreSQL will convert everything that is not delimited to lower case -
which is probably why it says "tvdacad001" can't be found when your
entity defines it as "TVDACAD001". You mention that it is defined in
the db as "TVDACAD001", did you delimit the table name when you created
it? If so, it must also be delimited when used. Try changing the
annotation to @Table(name = "\"TVDACAD001\"")
If that doesn't help, I'd recommend turning setting the logging level to
fine or finest to see the statements that is causing the error, and see
if you can access the table using the same user account the connection
pool is.

Best Regards,
Chris

Alea Management & Technology Solutions wrote:
> Hey,
>
> I am new to EJB3.0 and I am creating a simple EJB example
> using GlassFish and PostgreSQL.
>
> I am getting the org.postgre.util.PSQLException:ERROR: relation
> "tvdacad001" does not exist
>
> The database name "tvdacad001" is not written in lowercase anywhere.
> Inside Postgre database the database table
> is TVDACAD001 so in the entity class Company.java too.
>
> Please, find attached:
> . A SessionBean called (CompanyBean)
> . An Entity called (Company)
>
> Any help would be great.
>
> Thanks much,
>
> --
> Lee