Return-Path: Delivered-To: apmail-incubator-cayenne-user-archive@locus.apache.org Received: (qmail 62062 invoked from network); 19 Jun 2006 13:14:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 Jun 2006 13:14:08 -0000 Received: (qmail 59156 invoked by uid 500); 19 Jun 2006 13:14:07 -0000 Delivered-To: apmail-incubator-cayenne-user-archive@incubator.apache.org Received: (qmail 58977 invoked by uid 500); 19 Jun 2006 13:14:06 -0000 Mailing-List: contact cayenne-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cayenne-user@incubator.apache.org Delivered-To: mailing list cayenne-user@incubator.apache.org Received: (qmail 58968 invoked by uid 99); 19 Jun 2006 13:14:05 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Jun 2006 06:14:05 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of gcjcu-cayenne-user-moved1@m.gmane.org designates 80.91.229.2 as permitted sender) Received: from [80.91.229.2] (HELO ciao.gmane.org) (80.91.229.2) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Jun 2006 06:14:05 -0700 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FsJZL-0006g7-Gj for cayenne-user@incubator.apache.org; Mon, 19 Jun 2006 15:13:31 +0200 Received: from mail2.hayesinc.com ([207.10.43.2]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 19 Jun 2006 15:13:31 +0200 Received: from aperez by mail2.hayesinc.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 19 Jun 2006 15:13:31 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: cayenne-user@incubator.apache.org From: Arturo Perez Subject: Problem traversing relationships - need hint Date: Mon, 19 Jun 2006 13:13:15 +0000 (UTC) Lines: 35 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 207.10.43.2 (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4) Sender: news X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi all, I had this problem with the last beta and was hoping RC1 would fix but no such luck. I have 4 entities, Article, ArticleMeta, ArticleCategory and ArticleCategoryLink. ArticleCategoryLink is just a join table between ArticleMeta and ArticleCategory. (I don't do flattened relationships yet). ArticleMeta has a FK/relationship to Article. If I do this Iterator i = articleCategory.getArticles().iterator(); while (i.hasNext()) { ArticleCategoryLink acl = (ArticleCategoryLink)i.next(); ArticleMeta am = acl.getLatestArticle(); Article a = am.getArticle(); } The article is null but if I run an Expression I get what I expect: Expression exp = ExpressionFactory.matchExp("activeArticle.categories.category", category); exp = exp.andExp( Expression.fromString("latestArticle.article activeArticle.article")); DataContext dbContext = ArticleManager.getArticleManager().getDataContext(); SelectQuery catQuery = new SelectQuery(Article.class, exp); Any suggestions on where to look for improperly defined model etc? tia, arturo