[Nitro] Og problem...

Emmanuel Piperakis epiperak at softlab.ece.ntua.gr
Thu Oct 6 21:24:43 EDT 2005

Hi everyone,

I have discovered a problem with inheritance in Og. (I am not sure if it 
is a problem or not).

class Report
   property :a, String
   has_many :lines

class Subreport < Report
   property :b, String

class Line
   property :c, String
   belongs_to :report

The problem is that I would expect:
1) Subreport to inherit the has_many, from Report, therefore report.lines 
would exist (which it does not)
2) Line has a report_oid (as expected) and line.report returns the report. 
I would have a way to find the subreport from line directly. I know it 
does not sound easy, but is there a way? (at the moment I have to find the 
Subreport I am interested in and the query all the Lines with report_oid = 
to the subreports' oid. This solution is not so elegant, and actually not 
correct: eg in the case where I have Subreport_a and Subreport_b, then the 
line.report_oid would end up having same oids and a simple query like I 
mentioned before will not work). What I suggets is that Og could create 
line.subreport_a_oid and line.subreport_b_oid automatically for all the 
subclasses of report. How does that sound?

Thanx :-)

Emmanouil Piperakis (epiperak at cs.ntua.gr)
{To explore is Human, to Create is Devine,
  To teach is Primal, to Rule is Sin}

More information about the Nitro-general mailing list