javavalidationinheritanceisis

Apache Isis jdoqlFromClause validation error with multi-level inheritance



I've just upgraded Apache Isis to the latest version 1.14.0 in my project and faced with the next problem:
1) I have 3 domain objects with multi-level inheritance (in the same package): A, B, C

@DomainObject(objectType = "A", editing = Editing.ENABLED)
public abstract class A

@DomainObject(objectType = "B", editing = Editing.ENABLED)
public class B extends A

@DomainObject(objectType = "C", editing = Editing.ENABLED)
public class C extends B

2) class A has the following JDOQL query:

@Queries({
        @Query(
                name = "getById",
                value = "SELECT "
                        + "FROM com.home.test.A "
                        + "WHERE id == :id")
      })

3) When I turned on the validation:

isis.reflector.validator.jdoqlFromClause=true

I've got the error:

java.lang.AssertionError: Metamodel is invalid: 
com.home.test.C: error in JDOQL query, class name after FROM clause should be same as class name on which annotated, or one of its supertypes (JDOQL : SELECT FROM com.home.test.A WHERE id == :id)

4)If I make one-level inheritance:

@DomainObject(objectType = "A", editing = Editing.ENABLED)
public abstract class A

@DomainObject(objectType = "B", editing = Editing.ENABLED)
public class B extends A

@DomainObject(objectType = "C", editing = Editing.ENABLED)
public class C extends A

The validation passes OK.

Please help to pass jdoqlFromClause validation with multi-level inheritance.

Thank you!


Solution

  • Hmm, so, this needs to be improved I think. Thanks for writing this up.

    Could you raise a defect on our JIRA, please?

    Thx Dan