Re: [Fwd: Re: Problem Inheritance and casting]

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Dec 23 2004 - 12:37:33 EST

  • Next message: Andrus Adamchik: "Re: CayenneDataObject's 'validateForInsert, validateForUpdate, validateForDelete'"

    Ok, I know what it is... Inheritance qualifier uses a relationship, so the
    right class can't be determined properly from a data row.

    >>> Class Qualifier
    >>> ----- ---------
    >>> Role
    >>> SystemRole type.name = "system"
    >>> TimeSheetRole type.name = "timesheet"

    Workaround: instead of type.name use an expression based on FK, something
    like "db:type_id = 123" - I know it ain't pretty, but at least it stays in
    the model, and is hidden from Java code.

    Short term fix: we should probably detect such cases and throw an
    exception (and validate them in the modeler).

    Long term fix will likely be possible after we fix CAY-15 (which seems
    unrelated, but the underlying working is similar -
    http://objectstyle.org/cayenne/lists/cayenne-devel/2004/12/0014.html).
    I'll probably open a report in JIRA to reflect all these options.

    Andrus



    This archive was generated by hypermail 2.0.0 : Thu Dec 23 2004 - 12:37:35 EST