Uploaded image for project: 'Causeway'
  1. Causeway
  2. CAUSEWAY-1789

Metamodel validator thinks SQL query is a JDOQL query and fails

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.15.1
    • 1.16.0
    • Core
    • None
    • LINUX

    Description

      the following SQL Query definition :

      
      @javax.jdo.annotations.Queries(Array(
        new javax.jdo.annotations.Query(
          name = "findByDescriptiveName",
          value = "SELECT "
            + "FROM domainapp.modules.system.dom.impl.FileObject "
            + "WHERE descriptiveName.indexOf(:descriptiveName) >= 0 "),
        new javax.jdo.annotations.Query(
          name = "findByApplicationComponent",
          language="SQL",
          value = "select fo.* " +
                  " from " +
                  "    FileObject fo, " +
                  "     Component_File cf, " +
                  "     ComponentObject co, " +
                  "     Application_Component ac, " +
                  "     ApplicationObject ao " +
                  " where " +
                  "    ao.name = :application and " +
                  "     ao.application_id = ac.application_id and " +
                  "     co.component_id = ac.component_id and " +
                  "     co.name = :component and " +
                  "     co.component_id = cf.component_id and " +
                  "     cf.file_id = fo.file_id ",
          resultClass=classOf[FileObject] )
        )
      )
      

      makes the metamodel validator fail thinking that the query type is JDOQL.

      domainapp.modules.system.dom.impl.FileObject: error in JDOQL query, class name for FROM clause not recognized (JDOQL : select fo.*  from  	  FileObject fo,      Component_File cf,      ComponentObject co,      Application_Component ac,      ApplicationObject ao  where  	  ao.name = :application and      ao.application_id = ac.application_id and      co.component_id = ac.component_id and      co.name = :component and      co.component_id = cf.component_id and      cf.file_id = fo.file_id )
      
      Please inspect the above messages and correct your domain model.
      

      The validator should ignore SQL query types and let DataNucleus handle it.

      Attachments

        Activity

          People

            danhaywood Daniel Keir Haywood
            gerrie.myburgh@yahoo.co.uk Gerrie Myburgh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: