persistence@glassfish.java.net

Re[2]: How to change SQL-statements for Persistence Unit

From: Dmitry Mozheyko <mozheyko_d_at_mail.ru>
Date: Fri, 17 Mar 2006 15:00:33 +0300

> Did you specify any platform in you persistence.xml? The code tries to
> autodetect the database type, but if you specify it explicitly, your
> value will be used instead.

Where i can find docs, examples about this file?

>
> You can create the tables yourself, and do not rely on the automatic
> table creation.



>
> Regards,
> -marina
>
> Дмитрий Можейко wrote:
> > I create JDBC-resource for PostgreSQL on GlassFish.
> > And try to deploy ejb3 sample from netbeans site (http://www.netbeans.org/kb/55/ejb3-preview.html).
> > I give errors:
> >
> > ...
> > JDO76609: Got SQLException executing statement "CREATE TABLE CUST_ORDER (ID NUMBER(19) NOT NULL, DUEDATE TIMESTAMP, CUSTOMER VARCHAR, PRIMARY KEY (ID))": org.postgresql.util.PSQLException: ERROR: syntax error near "("
> > JDO76609: Got SQLException executing statement "CREATE TABLE ORDER_ITEM (ID NUMBER(19) NOT NULL, ITEM_ID NUMBER(19) NOT NULL, PRIMARY KEY (ID, ITEM_ID))": org.postgresql.util.PSQLException: ERROR: syntax error near "("
> > JDO76609: Got SQLException executing statement "CREATE TABLE ITEM (ITEM_ID NUMBER(19) NOT NULL, DESCRIPTION VARCHAR, PRIMARY KEY (ITEM_ID))": org.postgresql.util.PSQLException: ERROR: syntax error near "("
> > JDO76609: Got SQLException executing statement "CREATE TABLE SEQUENCE (SEQ_NAME VARCHAR(50), SEQ_COUNT NUMBER(19))": org.postgresql.util.PSQLException: ERROR: syntax error near "("
> > JDO76609: Got SQLException executing statement "INSERT INTO SEQUENCE(SEQ_NAME, SEQ_COUNT) values ('SEQ_GEN', 0)": org.postgresql..util.PSQLException: ERROR: relation "sequence" does not exists
> >
> >
> > How i can change create-table-statements, sql-jdbc-mappings and others sql-options for persistence unit?
>