You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@isis.apache.org by Gerrie Myburgh <ge...@yahoo.co.uk.INVALID> on 2017/12/01 16:07:14 UTC

Fw: Metamodel validator thinks SQL query is a JDOQL query

 Hi,

I have the following SQL query definition in scala : 
@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] )
  )
)findByApplicationComponent has the language defined as SQL but the metamodel validator thinks it is a JDOQL.  How can I define the query to be SQL so that DataNucleus will process it is such? 

################################################ ISIS METAMODEL VALIDATION ERRORS ###################################
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.
################################################ ISIS METAMODEL VALIDATION ERRORS ###################################
Thanks
Gerrie Myburgh  

Re: Fw: Metamodel validator thinks SQL query is a JDOQL query

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
Could you raise a ticket for that on JIRA?  I think the metamodel validator
should simply ignore such SQL query definitions.

As a work around, you could try to register a custom metamodel validator,
see [1]

thx
Dan

[1]
http://isis.apache.org/guides/ugbtb/ugbtb.html#_ugbtb_programming-model_custom-validator


On Fri, 1 Dec 2017 at 16:07 Gerrie Myburgh
<ge...@yahoo.co.uk.invalid> wrote:

>  Hi,
>
> I have the following SQL query definition in scala :
> @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] )
>   )
> )findByApplicationComponent has the language defined as SQL but the
> metamodel validator thinks it is a JDOQL.  How can I define the query to be
> SQL so that DataNucleus will process it is such?
>
> ################################################ ISIS METAMODEL VALIDATION
> ERRORS ###################################
> 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.
> ################################################ ISIS METAMODEL VALIDATION
> ERRORS ###################################
> Thanks
> Gerrie Myburgh