Fix DDC-2234
test NOT EXISTS expression
keep braces
Merge pull request #551 from FabioBatSilva/DDC-2234

[DDC-2234] FUNCTION() IS NULL comparison
[DDC-2246] Fix bug with UnitOfWork#getEntityState() and entities with foreign identifier.
Merge branch 'DDC-2246'
[DDC-2243] Fix bug where a bigint identifier would be casted to an integer, causing inconsistency with the string handling.
Merge branch 'DDC-2243'