Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-1114

EJBQLQuery fails on joins outside of public schema

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0
    • 3.0M5
    • Core Library
    • None

    Description

      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.

      Attachments

        1. fixEJBQLTableAlias.patch
          5 kB
          Dave Dombrosky

        Activity

          People

            andrus Andrus Adamchik
            shentalus Dave Dombrosky
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: