Bugs item #576649, was opened at 2002-07-03 08:52
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=576649&group_id=22866
Category: JBossCMP
Group: v3.0 Rabbit Hole
Status: Open
Resolution: None
Priority: 5
Submitted By: Stephen Coy (scoy)
Assigned to: Nobody/Anonymous (nobody)
Summary: JBossQL ordered queries and Sets broken?
Initial Comment:
If I declare an ejbSelect method:
public abstract Set ejbSelectUserLists(UserLocal user)
throws javax.ejb.FinderException;
and override the ejb-ql with JBossQL in jbosscmp-jdbc.xml like:
<query>
<query-method>
<method-name>ejbSelectUserLists</method-name>
<method-params>
<method-param>com.whitesmiths.sacha.ejb.auth.interfaces.UserLocal</method-param>
</method-params>
</query-method>
<jboss-ql>SELECT DISTINCT rs.role.worklist FROM User AS u, IN (u.userRoleSeqs) AS rs
WHERE rs.role.worklist IS NOT NULL AND u = ?1 ORDER BY rs.role.worklist.precedence
ASC</jboss-ql>
</query>
with an ORDER BY clause, then the ordering of the collection is lost when it gets
stuffed into a HashSet for return to the caller.
I think the relevant code is around line 86 in
org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCSelectorBridge.
I don't know what the pros/cons are of using a java.util.TreeSet are for this purpose,
especially since it is clearly overkill when ordering is not requested.
This is easily resolvable by using DISTINCT in the query and returning a Collection
for the time being, so the solution may be to simply document it this way.
CVS branch: Branch_3_0
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=576649&group_id=22866
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
No, I will not fix your computer.
http://thinkgeek.com/sf
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development