cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAY-2175) AliasName used in EJBQLQuery is not working if it contains mixed case.
Date Mon, 19 Dec 2016 14:32:58 GMT

    [ https://issues.apache.org/jira/browse/CAY-2175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15761301#comment-15761301
] 

ASF GitHub Bot commented on CAY-2175:
-------------------------------------

GitHub user stariy95 opened a pull request:

    https://github.com/apache/cayenne/pull/165

    CAY-2175 AliasName used in EJBQLQuery is not working if it contains mixed case

    Fix and tests

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/stariy95/cayenne CAY-2175

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cayenne/pull/165.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #165
    
----
commit 8ea40b0ede74db9bf58ff97da51317f0dcd1d20f
Author: Nikita Timofeev <stariy95@gmail.com>
Date:   2016-12-19T14:05:56Z

    CAY-2175 AliasName used in EJBQLQuery is not working if it contains mixed case
    Fix and tests

----


> AliasName used in EJBQLQuery is not working if it contains mixed case.
> ----------------------------------------------------------------------
>
>                 Key: CAY-2175
>                 URL: https://issues.apache.org/jira/browse/CAY-2175
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Core Library
>    Affects Versions: 4.0.M4
>            Reporter: Saravana Kumar M
>              Labels: easyfix
>             Fix For: 4.0.M4
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> While using EJBQLQuery, the alias name is not working if it is in mixed case and throws
some exception saying: "unmapped id variable:"
> Eg:
> Working:
> EJBQLQuery query = new EJBQLQuery("SELECT artistAlias from Artist artistAlias JOIN artistalias.paintings
paintingsAlias where artistalias.artistName = 'Abcd');
> Not Working:
> EJBQLQuery query = new EJBQLQuery("SELECT artistAlias from Artist artistAlias JOIN artistAlias.paintings
paintingsAlias where artistAlias.artistName = 'Abcd');
> We declared the alias variable as "artistAlias" but it is not working if you say artistAlias.artistName
and working if you say artistalias.artistName
> In Compiler.java class, visitFromItem... method
> while adding the alias variable name in the dictionary we convert it into lower case
> // per JPA spec, 4.4.2, "Identification variables are case insensitive."
> String id = normalizeIdPath(expression.getId());
> ClassDescriptor old = descriptorsById.put(id, descriptor);
> but in visitPath... method while retrieving the alias variable name from the dictionary
we are not converting to lower case.
>                 
> this.id = ((EJBQLPath) expression).getId();
> this.descriptor = descriptorsById.get(id);
> if (descriptor == null) {
>           throw new EJBQLException("Unmapped id variable: " + id);
>           }



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message