Re: Inheritance not resolving

From: Mike Kienenberger (mkienen..mail.com)
Date: Mon Feb 26 2007 - 22:08:02 EST

  • Next message: Michael Gentry: "Re: security - revisited"

    Are these primary keys?

    http://issues.apache.org/cayenne/browse/CAY-329

    On 2/26/07, Nick Peeples <nick.peeple..mail.com> wrote:
    > I have made progress. It seems that in the
    > org.apache.cayenne.exp.parser.ASTEqual class line 82 during the
    > EntityInheritanceTree matching, for some reason Longs are getting
    > comparedTo Integers... which obviously doesn't work. I am going to dig
    > in more in the morning to see if I can get the proper fix here.
    >
    > I would assume that this is something related to the qualifiers not
    > being setup correctly. The field is definitely supposed to be a Long
    > to a BigInt mapping, but the entity resolver seems to see things
    > differently.
    >
    > -Nick
    >
    > On 2/26/07, Nick Peeples <nick.peeple..mail.com> wrote:
    > > I have done pretty much everything on the pages for the docs, and that
    > > is partially what is bugging me a little bit, it seems to work
    > > everywhere but in my case. A thought just occurred, is it possible
    > > that this is something related to jre1.5?
    > >
    > > KlassA query (top class):
    > > SELECT t0.company_id, t0.create_dt_tm, t0.name, t0.status_cd,
    > > t0.type_cd, t0.id FROM dbo.catalog t0
    > >
    > > KlassB query (there is a KlassC extends KlassB):
    > > SELECT t0.company_id, t0.create_dt_tm, t0.name, t0.status_cd,
    > > t0.type_cd, t0.id FROM dbo.catalog t0 WHERE (t0.type_cd = ?) OR
    > > (t0.type_cd = ?) [bind: 452, 453]
    > >
    > > -Nick
    > >
    > > On 2/26/07, Michael Gentry <blacknex..mail.com> wrote:
    > > > I'm not sure if this page will help at all:
    > > >
    > > > http://cayenne.apache.org/doc20/modeling-inheritance.html
    > > >
    > > > Also, could you show us the SELECT that is issued when you try query a KlassB?
    > > >
    > > > Thanks!
    > > >
    > > > /dev/mrg
    > > >
    > > >
    > > > On 2/26/07, Nick Peeples <nick.peeple..mail.com> wrote:
    > > > > I do have the Qualifier filled in. Everything that is online in either
    > > > > the user doc or the modeler doc is currently being done, that is why
    > > > > this is confusing me a little bit.
    > > > >
    > > > > A little bit more, the objects that are in the cache are even not
    > > > > being subclasses properly either. Just poking around a bit, if I do a:
    > > > >
    > > > > return (KlassB) DataObjectUtils.objectForPk(context, obj.getObjectId());
    > > > >
    > > > > on an object that i know is of KlassB extends KlassA, it gets an Cast
    > > > > error. The obj was put in the cache by a:
    > > > >
    > > > > SelectQuery query = new SelectQuery(KlassA.class);
    > > > >
    > > > > Not sure if that helps at all.
    > > > >
    > > > > -Nick
    > > > >
    > > > > On 2/26/07, Michael Gentry <blacknex..mail.com> wrote:
    > > > > > Make sure in Cayenne Modeler, under the ObjEntity (Entity tab) for
    > > > > > your subclasses, you have the Qualifier filled in. If not, that could
    > > > > > be the issue.
    > > > > >
    > > > > > /dev/mrg
    > > > > >
    > > > > >
    > > > > > On 2/26/07, Nick Peeples <nick.peeple..mail.com> wrote:
    > > > > > > Yes, I have Cayenne pumping out all the logs through log4j. If I do
    > > > > > > the SelectQuery for the highest class, it returns all the rows, so in
    > > > > > > that regard it is working, and if i go down the chain towards the
    > > > > > > bottom, the exclusion rules do kick in, and the proper classes are
    > > > > > > returned. It just the lower subclasses are not being resolved to their
    > > > > > > proper, lowest class.
    > > > > > >
    > > > > > > -Nick
    > > > > > >
    > > > > > > On 2/26/07, Michael Gentry <blacknex..mail.com> wrote:
    > > > > > > > Do you have SQL logging turned on? That might could help quite a bit.
    > > > > > > >
    > > > > > > > Thanks,
    > > > > > > >
    > > > > > > > /dev/mrg
    > > > > > > >
    > > > > > > >
    > > > > > > > On 2/26/07, Nick Peeples <nick.peeple..mail.com> wrote:
    > > > > > > > > I am relatively new to Cayenne, but have run into a recent problem. I
    > > > > > > > > am using the single-table inheritance method, and I have a few
    > > > > > > > > subclasses of a generic object. According to the docs and wiki, by
    > > > > > > > > default they will be generated into the lowest possible subclass, but
    > > > > > > > > this doesn't seem to be happening. I can create them just fine, the
    > > > > > > > > qualifiers are all setup, but when I attempt a query,
    > > > > > > > > http://cayenne.apache.org/doc20/handling-inheritance.html, for the
    > > > > > > > > generic class, they are not resolving. The qualifier is being set
    > > > > > > > > correctly in the database.
    > > > > > > > >
    > > > > > > > > I am fully happy to attempt to solve this, but I don't have the
    > > > > > > > > slightest where to start. So I guess my question is, where would I
    > > > > > > > > start, or did i miss some obscure setting that I forgot to set?
    > > > > > > > >
    > > > > > > > > Thank you,
    > > > > > > > > Nick
    > > > > > > > >
    > > > > > > > > ps - setResolvingInheritance(true) doesn't help... but as far as docs
    > > > > > > > > it is the default, so I didn't expect much.
    > > > > > > > >
    > > > > > > >
    > > > > > >
    > > > > >
    > > > >
    > > >
    > >
    >



    This archive was generated by hypermail 2.0.0 : Mon Feb 26 2007 - 22:08:40 EST