[JBoss-user] [Beginners Corner] - Re: Can I use nested query in ejb finders?
Yes it works. View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3877622#3877622 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3877622 --- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7393alloc_id=16281op=click ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Beginners Corner] - Re: Can I use nested query in ejb finders?
Hi did the declared-sql work??? Cheers View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3877119#3877119 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3877119 --- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7393alloc_id=16281op=click ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Beginners Corner] - Re: Can I use nested query in ejb finders?
Thanks a lot. Its working fine. Regards Amit View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3876099#3876099 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3876099 --- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Beginners Corner] - Re: Can I use nested query in ejb finders?
That was so nice of you! I will try it out. Well, I need to use the subquery since the logic demands it. If this declared-sql does not work I will move to jdbc and fire plain sql to get the pk of the record and then move on with rest of the code after the finder. Thanks a lot again. View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3876051#3876051 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3876051 --- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Beginners Corner] - Re: Can I use nested query in ejb finders?
Not yet. I could not figure out how to construct the declare-sql clauses. Can you help me out? The query is not trivial . SELECT OBJECT(o) FROM CPRecoverLog o WHERE o.status = ?1 AND o.CPTransactionId = ( SELECT MIN(o1.CPTransactionId) FROM CPRecoverLog o1 WHERE o1.status = ?1) View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3876012#3876012 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3876012 --- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Beginners Corner] - Re: Can I use nested query in ejb finders?
Hi, try (cannot test if works): declared-sql o WHERE o.status = {0} AND o.CPTransactionId = ( SELECT MIN(o1.CPTransactionId) FROM CPRecoverLog o1 WHERE o1.status = {0}) /declared-sql But do you relly need a subquery ? Hope this helps View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3876024#3876024 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3876024 --- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Beginners Corner] - Re: Can I use nested query in ejb finders?
Sorry... anonymous wrote : | declared-sql | | o | | WHERE o.status = {0} AND o.CPTransactionId =( SELECT MIN(o1.CPTransactionId) FROM CPRecoverLog o1 WHERE o1.status = {0}) | | /declared-sql | | View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3876025#3876025 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3876025 --- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Beginners Corner] - Re: Can I use nested query in ejb finders?
reSorry | declared-sql | select | aliaso/alias | /select | whereWHERE o.status = {0} AND o.CPTransactionId = ( SELECT MIN(o1.CPTransactionId) FROM CPRecoverLog o1 WHERE o1.status = {0})/where | order/order | /declared-sql | | View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3876027#3876027 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3876027 --- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Beginners Corner] - Re: Can I use nested query in ejb finders?
Hi, Actually I had tried with JBoss-QL also. But its giving same problem. Do you know how to use subqueries as mentioned in my original post ? Regards Amit View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3875868#3875868 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3875868 --- SF.Net email is sponsored by: Tell us your software development plans! Take this survey and enter to win a one-year sub to SourceForge.net Plus IDC's 2005 look-ahead and a copy of this survey Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Beginners Corner] - Re: Can I use nested query in ejb finders?
Hello, have you tried declared-sql ? Ciao, Franco View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3875949#3875949 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3875949 --- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Beginners Corner] - Re: Can I use nested query in ejb finders?
Hi, I think that ejb 2.x do not support subqueries. You may try with jbossql. View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3875826#3875826 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3875826 --- SF.Net email is sponsored by: Tell us your software development plans! Take this survey and enter to win a one-year sub to SourceForge.net Plus IDC's 2005 look-ahead and a copy of this survey Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Beginners Corner] - Re: Can I use nested query in ejb finders?
Note that the same query was working in Weblogc 8.1 The exception I get in JBoss 4.0.1 SP1 is - 2005-04-27 17:34:25,170 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.keygen.JDBCSybaseCreateCommand.CPRecoverLog] Insert Entity SQL: INSERT INTO CPRecoverLog (cp_transaction_id, attemptCount, status, type, object, timeEntered, timeUpdated) VALUES (?, ?, ?, ?, ?, ?, ?) 2005-04-27 17:34:25,170 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCommandFactory.CPRecoverLog] entity-command: [commandName=sybase-fetch-key,commandClass=class org.jboss.ejb.plugins.cmp.jdbc.keygen.JDBCSybaseCreateCommand,attributes={pk-sql=SELECT @@IDENTITY}] 2005-04-27 17:34:25,186 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCRemoveEntityCommand.CPRecoverLog] Remove SQL: DELETE FROM CPRecoverLog WHERE id=? 2005-04-27 17:34:25,186 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.CPRecoverLog] Table not create as requested: CPRecoverLog 2005-04-27 17:34:25,186 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCFindByPrimaryKeyQuery.CPRecoverLog#findByPrimaryKey] SQL: SELECT t0_CPRecoverLog.id FROM CPRecoverLog t0_CPRecoverLog WHERE t0_CPRecoverLog.id=? 2005-04-27 17:34:25,186 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCQueryManager.CPRecoverLog] Added findByPrimaryKey query command for local home interface 2005-04-27 17:34:25,201 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCJBossQLQuery.CPRecoverLog#findByStatusUnique] JBossQL: SELECT OBJECT(o) FROM CPRecoverLog o WHERE o.status = ?1 AND o.CPTransactionId = (SELECT MIN(o1.CPTransactionId) FROM CPRecoverLog o1 WHERE o1.status = ?1) 2005-04-27 17:34:25,295 INFO [STDOUT] org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered SELECT at line 1, column 83. Was expecting one of: CONCAT ... SUBSTRING ... LCASE ... UCASE ... ( ... STRING_LITERAL ... STRING_VALUED_PARAMETER ... STRING_VALUED_PATH ... 2005-04-27 17:34:25,311 INFO [STDOUT] at org.jboss.ejb.plugins.cmp.ejbql.JBossQLParser.generateParseException(JBossQLParser.java:5614) 2005-04-27 17:34:25,326 INFO [STDOUT] at org.jboss.ejb.plugins.cmp.ejbql.JBossQLParser.jj_consume_token(JBossQLParser.java:5495) 2005-04-27 17:34:25,326 INFO [STDOUT] at org.jboss.ejb.plugins.cmp.ejbql.JBossQLParser.StringExpression(JBossQLParser.java:2086) 2005-04-27 17:34:25,326 INFO [STDOUT] at org.jboss.ejb.plugins.cmp.ejbql.JBossQLParser.StringPrimary(JBossQLParser.java:2105) 2005-04-27 17:34:25,326 INFO [STDOUT] at org.jboss.ejb.plugins.cmp.ejbql.JBossQLParser.StringExpression(JBossQLParser.java:2079) 2005-04-27 17:34:25,342 INFO [STDOUT] at org.jboss.ejb.plugins.cmp.ejbql.JBossQLParser.ComparisonExpression(JBossQLParser.java:1489) 2005-04-27 17:34:25,342 INFO [STDOUT] at org.jboss.ejb.plugins.cmp.ejbql.JBossQLParser.SimpleCondExpression(JBossQLParser.java:969) 2005-04-27 17:34:25,342 INFO [STDOUT] at org.jboss.ejb.plugins.cmp.ejbql.JBossQLParser.ConditionalPrimary(JBossQLParser.java:882) 2005-04-27 17:34:25,342 INFO [STDOUT] at org.jboss.ejb.plugins.cmp.ejbql.JBossQLParser.ConditionalTest(JBossQLParser.java:850) 2005-04-27 17:34:25,357 INFO [STDOUT] at org.jboss.ejb.plugins.cmp.ejbql.JBossQLParser.ConditionalFactor(JBossQLParser.java:827) 2005-04-27 17:34:25,357 INFO [STDOUT] at org.jboss.ejb.plugins.cmp.ejbql.JBossQLParser.WhereConditionalTerm(JBossQLParser.java:686) 2005-04-27 17:34:25,357 INFO [STDOUT] at org.jboss.ejb.plugins.cmp.ejbql.JBossQLParser.WhereExpression(JBossQLParser.java:629) 2005-04-27 17:34:25,357 INFO [STDOUT] at org.jboss.ejb.plugins.cmp.ejbql.JBossQLParser.WhereClause(JBossQLParser.java:593) 2005-04-27 17:34:25,357 INFO [STDOUT] at org.jboss.ejb.plugins.cmp.ejbql.JBossQLParser.EJBQL(JBossQLParser.java:126) 2005-04-27 17:34:25,357 INFO [STDOUT] at org.jboss.ejb.plugins.cmp.ejbql.JBossQLParser.parse(JBossQLParser.java:73) 2005-04-27 17:34:25,373 INFO [STDOUT] at org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLCompiler.compileJBossQL(JDBCEJBQLCompiler.java:194) 2005-04-27 17:34:25,373 INFO [STDOUT] at org.jboss.ejb.plugins.cmp.jdbc.JDBCJBossQLQuery.(JDBCJBossQLQuery.java:43) 2005-04-27 17:34:25,373 INFO [STDOUT] at org.jboss.ejb.plugins.cmp.jdbc.JDBCCommandFactory.createJBossQLQuery(JDBCCommandFactory.java:72) 2005-04-27 17:34:25,373 INFO [STDOUT] at org.jboss.ejb.plugins.cmp.jdbc.JDBCQueryManager.start(JDBCQueryManager.java:260) 2005-04-27 17:34:25,373 INFO [STDOUT] at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.startStoreManager(JDBCStoreManager.java:490) 2005-04-27 17:34:25,389 INFO [STDOUT] at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:381) 2005-04-27 17:34:25,389 INFO [STDOUT] at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:157) 2005-04-27 17:34:25,389 INFO [STDOUT] at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:340) 2005-04-27 17:34:25,389 INFO [STDOUT] at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)