Thank you, I've finally manged to get it to work using overriding jbossql.
I had a lot of trouble finding any documentation of the syntax or any examples,
and for any one else doing this there were two issues that I had to figure out.
First doing the count on the beans like
select count (r) from myNode r ...
does not work and gives an exception when it is run, but counting a cmp field
select count (r.ipHostname) from myNode r ...
does work.
The second thing I had to figure out is that count returns a Long.
Here are the new segments from my working code using xdoclet.
This was added to the class level tag (seems like it ought to be on the method level
tag)
| * @jboss.query
| * signature="java.lang.Long ejbSelectCountStatusRouters(java.lang.Integer
status)"
| * query="select count(rout.ipHostname) from myNode rout where rout.isRouter =
True and rout.status = ?1"
| *
|
then the two methods I added: an ejbSelect and an ejbHome:
| /**
| * @ejb.select
| * query="select count(r) from myNode r where r.isRouter = True and
r.status = ?1"
| *
| */
| public abstract java.lang.Long ejbSelectCountStatusRouters(java.lang.Integer
status) throws javax.ejb.FinderException;
|
| /**
| * @ejb.home-method
| * view-type = "local"
| *
| */
| public Long ejbHomeCountStatusRouters(java.lang.Integer status) throws
javax.ejb.FinderException {
| return ejbSelectCountStatusRouters(status);
| }
|
I hope this helps others,
Mark
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3840008#3840008
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3840008
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user