Hi,

> a) SQLSyntaxErrorException : Encountered "NOT" at line 1, column 185

Just seen your SQL generated. "WHERE NOT NOT (A0.OPTIONAL_PC IS NULL)"
That is valid on some RDBMS but maybe Derby is throwing its toys out of the 
pram due to it? Current DN code will put brackets in there. i.e NOT (NOT (...))


> b) optionalPC.get().id

Released DN code only supports "optionalPC.get()" and not the access of fields 
of the dereferenced object (i.e it didn't do a join to the related table 
holding the object). Current DN code does however support that. 
As I mentioned previously, if having problems use nightly builds.


> c) Optional.orElse is currently not supported

Yes it is, and has been since DataNucleus v5.0.0-m4. You must be using an old 
version.

Regarding a use-case for orElse, the test I use is putting the orElse in the 
SELECT clause

Query q = pm.newQuery("SELECT id, stringField.orElse('NotPresent') FROM 
mydomain.MyClass");

so I get back the value that is stored when it is set, or some other value if 
not set (much like could be achieved with a CASE statement with other 
datatypes).



Regards
-- 
Andy
DataNucleus (Web: http://www.datanucleus.org   Twitter: @datanucleus)

Reply via email to