Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Cannot pass null parameter

Hi Tom,

Thanks for your additional tests. I understand your concerns.

To be absolutely frank, I am just expecting this to work, because I am
very confident that every other developer would expect this to work,
too.

The JPQL is absolutely basic, even more so as to be equivalent with an
example from one of the most relevant articles that one can possibly
find on the web (wikipedia JPQL).

As you point out, some database engines appear to be mis-behaving,
including one that is supported by Oracle. However, OpenJPA seems to
be abstracting this away, effectively eliminating the error.

This is exactly what one would expect an ORM abstraction layer to do
in this case. IMHO it would make a lot of sense to me that EclipseLink
at the same time put priority pressure on database engine providers of
those mis-behaving databases.

This is exactly what developers must do in such scenarios on
application level: Work around the problem and at the same time file
issues against the provider; make a note in the workaround code
linking to the issue.

Unfortunately I cannot propose any other method such as advising what
SQL EclipseLink should generate. That is in the realm of the ORM
provider. I can only refer to OpenJPA where apparently the problem is
solved in whatever way, possibly with some ugly, inefficient code.

Kind Regards,

Bernard

On Tue, 01 Nov 2011 08:31:25 -0400, you wrote:

>It is still not clear to me what the SQL you are expecting is.
>
>I run the following SQL against Derby:
>
>"select * from auction_bid where (null is null)"
>
>And I get basically the same exception as you report in the bug.  I am not sure 
>what EclipseLink could do about this.  Is there a further exception, or more 
>details about the problem.
>
>When I run the above query against MySQL and against Oracle, it succeeds.  Based 
>on the details in the bug, this appears to be a limitation of Derby (and if the 
>exception is the same, PostGreSQL)  Can you help me understand why it is not.
>
>Thanks,
>-Tom
>
>On 31/10/2011 2:30 PM, bht@xxxxxxxxxxxxx wrote:
>> Both JavaDB and Postgresql
>>
>> Regards,
>>
>> Bernard
>>
>> On Mon, 31 Oct 2011 13:35:43 -0400, you wrote:
>>
>>> What SQL is open jpa producing?
>>>
>>> What DB are you on?
>>>
>>> I believe the EclipseLink SQL will work on some databases.
>>>
>>> -Tom
>>>
>>> On 31/10/2011 1:35 PM, bht@xxxxxxxxxxxxx wrote:
>>>> Hi Tom,
>>>>
>>>> In principle, I don't want to suggest any constraints on what SQL
>>>> EclipseLink should produce. The examples at
>>>>
>>>> http://en.wikipedia.org/wiki/Java_Persistence_Query_Language#Examples
>>>>
>>>> contain a compact JPQL as follows
>>>>
>>>> SELECT a FROM Author a WHERE :lastName IS NULL OR LOWER(a.lastName) =
>>>> :lastName
>>>>
>>>> which I have used successfully with OpenJPA in other projects.
>>>>
>>>> This type of query is very useful especially when expanded for
>>>> querying a large number of fields with only a sub-set of user-supplied
>>>> values, without having to generate the query in code which is a lot of
>>>> work and risky, or even more work but less risky when using the
>>>> criteria API.
>>>>
>>>> In
>>>>
>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=362414
>>>>
>>>> I plugged in OpenJPA with the following persistence.xml modifications:
>>>>
>>>> <property name="openjpa.Log" value="SQL=TRACE"/>
>>>> <property name="openjpa.jdbc.SynchronizeMappings"
>>>> value="buildSchema(SchemaAction=&apos;add,deleteTableContents&apos;,ForeignKeys=true)"/>
>>>>
>>>> and
>>>> -javaagent:openjpa-all-2.1.1.jar
>>>>
>>>> Their solution might not be EclipseLink's final solution, so
>>>> EclipseLink might in the end do something more intelligent - as long
>>>> as it works, that would be fine with me.
>>>>
>>>> The testcase is somewhat special because it queries related Region not
>>>> basic CustomerOrder so I should have added a basic case, too.
>>>>
>>>> Kind Regards,
>>>>
>>>> Bernard
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Mon, 31 Oct 2011 08:27:52 -0400, you wrote:
>>>>
>>>>> Hi Bernard,
>>>>>
>>>>>     The exception you are getting is a SQLException.  That comes from your
>>>>> database, not EclipseLink.  What SQL are you expecting us to produce?
>>>>>
>>>>> -Tom
>>>>>
>>>>> On 29/10/2011 10:51 PM, bht@xxxxxxxxxxxxx wrote:
>>>>>> Hi,
>>>>>>
>>>>>> Please help me find a workaround for
>>>>>>
>>>>>> Cannot pass null in Parameter as Identification variable or Primitive
>>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=362414
>>>>>>
>>>>>> I am really perplexed because this seems to be quite basic. I made a
>>>>>> cross check - it works in OpenJPA.
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Bernard
>>>>>>
>>>>>> _______________________________________________
>>>>>> eclipselink-users mailing list
>>>>>> eclipselink-users@xxxxxxxxxxx
>>>>>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>>>>> _______________________________________________
>>>>> eclipselink-users mailing list
>>>>> eclipselink-users@xxxxxxxxxxx
>>>>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>>>>
>>>> _______________________________________________
>>>> eclipselink-users mailing list
>>>> eclipselink-users@xxxxxxxxxxx
>>>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>>> _______________________________________________
>>> eclipselink-users mailing list
>>> eclipselink-users@xxxxxxxxxxx
>>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>>
>> _______________________________________________
>> eclipselink-users mailing list
>> eclipselink-users@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>_______________________________________________
>eclipselink-users mailing list
>eclipselink-users@xxxxxxxxxxx
>https://dev.eclipse.org/mailman/listinfo/eclipselink-users



Back to the top