You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cayenne.apache.org by "Dave Dombrosky (JIRA)" <de...@cayenne.apache.org> on 2008/10/01 21:48:12 UTC
[jira] Created: (CAY-1114) EJBQLQuery fails on joins outside of
public schema
EJBQLQuery fails on joins outside of public schema
--------------------------------------------------
Key: CAY-1114
URL: https://issues.apache.org/cayenne/browse/CAY-1114
Project: Cayenne
Issue Type: Bug
Components: Cayenne Core Library
Affects Versions: 3.0
Reporter: Dave Dombrosky
Assignee: Andrus Adamchik
I noticed that my EJBQL queries were failing because of incorrect table aliases. I did some troubleshooting and found out that the key for the table alias would sometimes be different depending on which translator/appender was running.
The problem turned out to be getting the name from the DBEntity. In some places it was just getting the regular name (DbEntity.getName()) while in other places, it was getting the full name (DbEntity.getFullyQualifiedName()). This is only a problem when you have a table in a schema other than public, because for the public schema the two method calls return the same value.
Changing the calls to EJBQLTranslationContext.getTableAlias() to always use the fully qualified name seems to have fixed my issues.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAY-1114) EJBQLQuery fails on joins outside of
public schema
Posted by "Andrus Adamchik (JIRA)" <de...@cayenne.apache.org>.
[ https://issues.apache.org/cayenne/browse/CAY-1114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13130#action_13130 ]
Andrus Adamchik commented on CAY-1114:
--------------------------------------
Dave, would you mind to post a patch or at least a generated SQL (if it is not something confidential)?
Thanks, Andrus
> EJBQLQuery fails on joins outside of public schema
> --------------------------------------------------
>
> Key: CAY-1114
> URL: https://issues.apache.org/cayenne/browse/CAY-1114
> Project: Cayenne
> Issue Type: Bug
> Components: Cayenne Core Library
> Affects Versions: 3.0
> Reporter: Dave Dombrosky
> Assignee: Andrus Adamchik
> Attachments: fixEJBQLTableAlias.patch
>
>
> I noticed that my EJBQL queries were failing because of incorrect table aliases. I did some troubleshooting and found out that the key for the table alias would sometimes be different depending on which translator/appender was running.
> The problem turned out to be getting the name from the DBEntity. In some places it was just getting the regular name (DbEntity.getName()) while in other places, it was getting the full name (DbEntity.getFullyQualifiedName()). This is only a problem when you have a table in a schema other than public, because for the public schema the two method calls return the same value.
> Changing the calls to EJBQLTranslationContext.getTableAlias() to always use the fully qualified name seems to have fixed my issues.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (CAY-1114) EJBQLQuery fails on joins outside of
public schema
Posted by "Dave Dombrosky (JIRA)" <de...@cayenne.apache.org>.
[ https://issues.apache.org/cayenne/browse/CAY-1114?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dave Dombrosky updated CAY-1114:
--------------------------------
Attachment: fixEJBQLTableAlias.patch
The fixEJBQLTableAlias.patch should take care of the issue.
However, there are a couple of exception handlers in the EJBQL translators that use just the getName() method. I'm not sure if these should also be using getFullyQualifiedName() to make things more clear in the error.
> EJBQLQuery fails on joins outside of public schema
> --------------------------------------------------
>
> Key: CAY-1114
> URL: https://issues.apache.org/cayenne/browse/CAY-1114
> Project: Cayenne
> Issue Type: Bug
> Components: Cayenne Core Library
> Affects Versions: 3.0
> Reporter: Dave Dombrosky
> Assignee: Andrus Adamchik
> Attachments: fixEJBQLTableAlias.patch
>
>
> I noticed that my EJBQL queries were failing because of incorrect table aliases. I did some troubleshooting and found out that the key for the table alias would sometimes be different depending on which translator/appender was running.
> The problem turned out to be getting the name from the DBEntity. In some places it was just getting the regular name (DbEntity.getName()) while in other places, it was getting the full name (DbEntity.getFullyQualifiedName()). This is only a problem when you have a table in a schema other than public, because for the public schema the two method calls return the same value.
> Changing the calls to EJBQLTranslationContext.getTableAlias() to always use the fully qualified name seems to have fixed my issues.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAY-1114) EJBQLQuery fails on joins outside of
public schema
Posted by "Andrus Adamchik (JIRA)" <de...@cayenne.apache.org>.
[ https://issues.apache.org/cayenne/browse/CAY-1114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13131#action_13131 ]
Andrus Adamchik commented on CAY-1114:
--------------------------------------
Oops, scratch that. You alreadt did :-) Thanks!
> EJBQLQuery fails on joins outside of public schema
> --------------------------------------------------
>
> Key: CAY-1114
> URL: https://issues.apache.org/cayenne/browse/CAY-1114
> Project: Cayenne
> Issue Type: Bug
> Components: Cayenne Core Library
> Affects Versions: 3.0
> Reporter: Dave Dombrosky
> Assignee: Andrus Adamchik
> Attachments: fixEJBQLTableAlias.patch
>
>
> I noticed that my EJBQL queries were failing because of incorrect table aliases. I did some troubleshooting and found out that the key for the table alias would sometimes be different depending on which translator/appender was running.
> The problem turned out to be getting the name from the DBEntity. In some places it was just getting the regular name (DbEntity.getName()) while in other places, it was getting the full name (DbEntity.getFullyQualifiedName()). This is only a problem when you have a table in a schema other than public, because for the public schema the two method calls return the same value.
> Changing the calls to EJBQLTranslationContext.getTableAlias() to always use the fully qualified name seems to have fixed my issues.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (CAY-1114) EJBQLQuery fails on joins outside of
public schema
Posted by "Andrus Adamchik (JIRA)" <de...@cayenne.apache.org>.
[ https://issues.apache.org/cayenne/browse/CAY-1114?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrus Adamchik closed CAY-1114.
--------------------------------
Resolution: Fixed
Fix Version/s: 3.0
patch applied and committed. thanx!
> EJBQLQuery fails on joins outside of public schema
> --------------------------------------------------
>
> Key: CAY-1114
> URL: https://issues.apache.org/cayenne/browse/CAY-1114
> Project: Cayenne
> Issue Type: Bug
> Components: Cayenne Core Library
> Affects Versions: 3.0
> Reporter: Dave Dombrosky
> Assignee: Andrus Adamchik
> Fix For: 3.0
>
> Attachments: fixEJBQLTableAlias.patch
>
>
> I noticed that my EJBQL queries were failing because of incorrect table aliases. I did some troubleshooting and found out that the key for the table alias would sometimes be different depending on which translator/appender was running.
> The problem turned out to be getting the name from the DBEntity. In some places it was just getting the regular name (DbEntity.getName()) while in other places, it was getting the full name (DbEntity.getFullyQualifiedName()). This is only a problem when you have a table in a schema other than public, because for the public schema the two method calls return the same value.
> Changing the calls to EJBQLTranslationContext.getTableAlias() to always use the fully qualified name seems to have fixed my issues.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.