Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-dev] unique nullable="false" fields have no ' NOT NULL' in DDL

Hi Dies,

  Here is the SQL I get when I run on MySQL.

CREATE TABLE DDL_CKENTB (DTYPE VARCHAR2(31) NULL, UNQ1 VARCHAR2(255) NOT NULL, UNQ2 VARCHAR2(255) NOT NULL, SEQ NUMBER(19) NOT NULL, CODE VARCHAR2(255) NOT NULL, PRIMARY KEY (SEQ, CODE))

  It seems to have the NOT NULL indications.

-Tom

Dies Koper wrote:
Hi,

I was wondering whether anyone noticed this already:

JPA LRG's JPtestDDLUniqueKeysAsJoinColumns fails on Symfoware because
the table could not be created.
The database complains that I'm defining a unique constraint on columns
that are nullable. This is CREATE statement:

CREATE TABLE DDL_CKENTB
(DTYPE VARCHAR(31),
UNQ1 VARCHAR(255),
UNQ2 VARCHAR(255),
SEQ NUMERIC(18) NOT NULL,
CODE VARCHAR(255) NOT NULL,
PRIMARY KEY (SEQ, CODE),
UNIQUE (UNQ2, UNQ1))

But the entity (CKeyEntityB) has them defined as non-nullable, it seems
that is ignored.

    @Column(name = "UNQ1", nullable = false)
    private String unq1;
    @Column(name = "UNQ2", nullable = false)
    private String unq2;

Thanks,
Dies

_______________________________________________
eclipselink-dev mailing list
eclipselink-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-dev


Back to the top