Miguel Ángel Laguna | 13 Jan 2005 19:59
Picon

Ambiguous class compilation error


Hello all:

I get once and again the same ambiguous class error when compiling my
component. 

I reviewed documentation and tutorial examples, and I don't understand
why. I have an "investigador"(researcher) class, an "estudio"(study)
class and a "participacion"(participation) class. 

A researcher participates in studies, so researches and studies have a
collection of participations, and participation has one researcher and
one study.

To be more precise I attach the related part of the component, and I
also make a comment on the erroneous line (function of the factory):

<class>
  <name>investigador</name>
...

  <variable>
    <name>login</name>
    <type>text</type>
  </variable>

  <collection>
    <name>participaciones</name>
    <class>participacion</class>
    <reference>participante</reference>
(Continue reading)

Manuel Lemos | 14 Jan 2005 00:42

Re: Ambiguous class compilation error


Hello,

on 01/13/2005 04:59 PM Miguel Ángel Laguna said the following:
> I get once and again the same ambiguous class error when compiling my
> component. 
> 
> I reviewed documentation and tutorial examples, and I don't understand
> why. I have an "investigador"(researcher) class, an "estudio"(study)
> class and a "participacion"(participation) class. 
> 
> A researcher participates in studies, so researches and studies have a
> collection of participations, and participation has one researcher and
> one study.
> 
> To be more precise I attach the related part of the component, and I
> also make a comment on the erroneous line (function of the factory):

When you use a reference to an standalone object in a filter expression 
it acts like a declaration of the the name and class of the object.

However, filter expressions and any implicit declarations are evaluated 
by the order of the appearance. Since you are referencing to that 
investigador object before its implicit declaration in the filter 
expression, Metastorage complains as it does not know yet what is that 
object.

The solution is simple: just invert the order of the condition clauses 
like this below. I confirmed that it works.

(Continue reading)


Gmane