|Re: [eclipselink-dev] unique nullable="false" fields have no ' NOT NULL' in DDL|
Hi Dies, My Derby Config seems to be producing NOT NULL for me.A search in the code shows me "NOT NULL" is produced in one method. DatabasePlatform.printFieldNotNullClause(). 'Any chance you are overriding somewhere.
That method is called in FieldDefintion.appendDBString(Writer writer, AbstractSession session, TableDefinition table). Can you tell why you are not getting to that method call?
-Tom Dies Koper wrote:
Hi Tom, I checked with Derby, no 'NOT NULL' either, so it's not just Symfoware. But when I checked my old logs (from September 2009), it did have it. Something must have changed since. I also just tried with Oracle, 'NOT NULL' is there.I noticed that when I comment out the following line in jpa\eclipselink.jpa.test\resource\eclipselink-ddl-generation-model\persistence.xml, the 'NOT NULL' indication reappears for Derby.<class>org.eclipse.persistence.testing.models.jpa.ddlgeneration.PropertyInfo</class>I've looked at this issue in the debugger for several hours but I have no idea what's going on. Any ideas?Thanks, Dies On 26/01/2010 08:27, Tom Ware wrote: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