Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Entity insert statement incorrect with multiple mapped subclasses.

På mandag 14. april 2014 kl. 15:26:59, skrev Shaun Smith <shaun.smith@xxxxxxxxxx>:
Hal,

    Chris is right.  I relaxed update_date and updated_by to nullable and the tests succeed with:

[EL Fine]: sql: 2014-04-14 09:24:57.928--ClientSession(1894821100)--Connection(1223069868)--Thread(Thread[main,5,main])--INSERT INTO test.agency (id, description, name, notes, pinned, update_date, updated_by) VALUES (1, NULL, CoRE, NULL, 0, NULL, NULL)
[EL Fine]: sql: 2014-04-14 09:24:57.933--ClientSession(1894821100)--Connection(1223069868)--Thread(Thread[main,5,main])--UPDATE test.agency SET updated_by = 1 WHERE (id = 1)
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.583 sec

    The issue is the self reference.  With Oracle DB you can set the not null constraint to be deferrable so that it is only validated at commit time.  Not sure if you can do this with PostgreSQL?
 
PG doesn't support deferrable NOT NULLs, you must use a constraint trigger to check for NULL and mark that trigger as deferrable.
 
--
Andreas Joseph Krogh <andreak@xxxxxxxxxxxx>      mob: +47 909 56 963
Senior Software Developer / CTO - OfficeNet AS - http://www.officenet.no
Public key: http://home.officenet.no/~andreak/public_key.asc
 

Back to the top