• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB QL generation using XDoclet  RSS feed

 
Janarthan Sathiamurthy
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using jboss 3.0.
I am 'new to' using xdoclet for code generation.
I have a finder method in my entity bean.
I want to specify the query for this method using xdoclet.
Table to query - user_table
Fields - username, password
My query in 'pure sql' is -
select username from user_table where username like '%user%'
I am not able to write this in EJB QL using Xdoclet.
Please help. :roll:
Janarthan S
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a good reference that explains how to use XDoclet in conjunction with EJBs.
http://www2.theserverside.com/resources/review/EJBCookbook/chapter2_EJBCookbook.zip
Hope that helps
Simon
 
Sam Dalton
Author
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Janarthan Sathiamurthy:
I am using jboss 3.0.
I am 'new to' using xdoclet for code generation.
I have a finder method in my entity bean.
I want to specify the query for this method using xdoclet.
Table to query - user_table
Fields - username, password
My query in 'pure sql' is -
select username from user_table where username like '%user%'
I am not able to write this in EJB QL using Xdoclet.
Please help. :roll:
Janarthan S

The way to do this is:
@ejb.finder signature="findByUserName" query="Select OBJECT(o) from user as u where u.name LIKE '%?1'"
For XDoclet reference look at XDoclet
For EJBQL reference look at EQL-QL.com
Hope this helps
Sam
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!