• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

EJB QL generation using XDoclet

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
sharp shooter, and author
Posts: 1913
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic