Re: Problem Inheritance and casting

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Wed Dec 22 2004 - 09:16:26 EST

  • Next message: Andrus Adamchik: "Re: Returning Raw ResultSets"

    Hi Justin,

    "Role.getRole(ctxt, VALID_TIMESHEET_ROLE_NAME)" executes one of your
    queries, right. So what is this query, and what SQL it generates? A few
    things to check: that there is at least one row returned (so getRole() is
    not null), and that a query "resolvingInherited" property is true (it is
    by default).

    Hope this helps.

    Andrus

    > Hi All,
    >
    > I'm having a problem with inheritance. I have the following tables,
    > where I am using Type as object type:
    >
    > Role Role_Type
    > ---- ---------
    > ID ID
    > Name Name
    > Description Description
    > Type -> Role_Type
    > Rate
    >
    > and the following classes:
    >
    > Class Qualifier
    > ----- ---------
    > Role
    > SystemRole type.name = "system"
    > TimeSheetRole type.name = "timesheet"
    >
    >
    > Everything seems to be working well, except when I try to retrieve a
    > Role and test whether or not the role is an instance of TimeSheetRole,
    > something like:
    >
    > r = Role.getRole(ctxt, VALID_TIMESHEET_ROLE_NAME);
    > if(r instaceof TimeSheetRole){
    > System.out.println("True");
    > } else {
    > System.out.println("False");
    > }
    >
    > This statement would return False, not True as I'm expecting. Now I
    > know that the VALID_TIMESHEET_ROLE_NAME is actually a TimeSheetRole,
    > because my other test use the same value.
    >
    > Dose any one have any ideas what my problem is?
    >
    > Thanks in advance.
    >
    > --
    > Justin Deutsch
    >
    > Relevance... because results count
    >
    > Relevance Phone: +61 (0)2 6241 6400
    > A.B.N. 86 063 403 690 Fax: +61 (0)2 6241 6422
    > Unit 11, Mobile: +61 (0)40 246 55 88
    > Cnr Brookes & Heffernan Sts, E-mail: Justin.Deutsc..elevance.com.au
    > Mitchell ACT 2911 Web: http://www.relevance.com.au



    This archive was generated by hypermail 2.0.0 : Wed Dec 22 2004 - 09:16:29 EST