From:     Stefan Arentz <[EMAIL PROTECTED]>
        Subject:        Unexpected JBossQL result in 3.2.2
        Date:   November 6, 2003 9:55:02 AM CET
        To:       [EMAIL PROTECTED]


My object model is pretty simple:


 Subscription
  user        -> User       (1:1)
  lastSession -> Session    (1:1) Can be null

I'm trying to query all Subscription objects that have a not null lastSession field and then order the result by Session.createDate.

I'm doing this with JBossQL in JBoss 3.2.2.

This works:

 SELECT DISTINCT OBJECT(s)
  FROM Subscriptions AS s, Sessions as z
  WHERE s.user = ?1 and s.lastSession is not null and s.lastSession = z
  ORDER BY s.lastSession.createDate
  DESC LIMIT ?2

It returns the correct Subscription commands.

This doesn't:

 SELECT DISTINCT OBJECT(s)
  FROM Subscriptions AS s
  WHERE s.user = ?1 and s.lastSession is not null
  ORDER BY s.lastSession.createDate
  DESC LIMIT ?2

It returns the cartasian product of Subscription/User objects.

Is this the expected behaviour?

S.



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to