So JDO is a mess (original report), certainly EJB is a mess (hence JDO), but let's face it, the root cause is the language itself.
First, JDOQL is an abomination. (There I said it.) There are four standard ways of expressing object-oriented queries: query language, query by criteria, query by example and native SQL. JDOQL is none of these.None of these is going to be very pleasing in a rigid language like Java.
In contrast, consider SchemeQL, or HaskellDB, or ROE for Smalltalk.
The difference between these and options for Java (or C# or VB.Net or C++ or Ada or Pascal or C or...)? The difference is in the simplicity of the root language (and note these are three very different languages, syntactically) as opposed to the rigidity. (Related note.)