Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

EJB QL generation using XDoclet

 
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
 
sharp shooter, and author
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
 
Author
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
 
God is a comedian playing for an audience that is afraid to laugh - Voltair. tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic