• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJBQL

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
how can i use order by in EJBQL statement ?
------------------
http://www.unit.br/zemaria
[This message has been edited by Jose, Santos (edited August 24, 2001).]
[This message has been edited by Jose, Santos (edited August 24, 2001).]
 
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, it�s great to see you around...
Well because the finder methods from the home interface should only return a pk(finbByPrimaryKey), or a Remote interface or a collection of remote interfaces, I don�t think there�s a way to use orderby from sql in the ql language from the ejb2.0 especifications.
But anyway, opinions from others on this subject woul�d be really appreciated.
regards.
 
Marcos Maia
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I kept thinking about it and I decide to go after the specification and than I found in the last paragraph of the topic 11.2.1 that select methods can return a cmp-field value or a collection of such, so I was wrong.
Anyway just store your result in a List and than you�ll have a sorted collection.
regards.
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can any body tell me what is EJBQL statement ???
 
Jose, Santos
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by sunil seth:
can any body tell me what is EJBQL statement ???


Text extract from www.theserverside.com : Masterting EJB 2.0
masteringejb-ejbql-july13.doc
"EJB-QL is a standard and portable language for expressing container-managed persistent entity bean query operations. These entity bean query operations can include finder methods (used by external entity bean clients), as well as select methods (used internally by the entity bean itself). EJB-QL is not necessary for bean-managed persistence because the bean provider writes the database access code, which is integrated into the entity bean class itself.
EJB-QL is a new addition to EJB 2.0. Before EJB 2.0, you would need to explain to the container how to implement your query operations in a proprietary way. For example, you might bundle a container-specific flat-file with your bean. This flat-file would not be portable to other containers, which is very annoying for bean-providers who wish to write components that are container-agnostic."
Resume:
EJBQL (Enterprise Java Beans Query Language) is an implemantation of OQL (Object Query Language). It is an Query Languagem based in Objects
[This message has been edited by Jose, Santos (edited August 25, 2001).]
 
Jose, Santos
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Marcos Maia:
Hi,
I kept thinking about it and I decide to go after the specification and than I found in the last paragraph of the topic 11.2.1 that select methods can return a cmp-field value or a collection of such, so I was wrong.
Anyway just store your result in a List and than you�ll have a sorted collection.
regards.


EJBQL can be use in the bean class to.
 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how do I use method parameters in the ejql? for example, I have a method like this:

how do I use the variables "start" and "end" in the ejbql?
I�m using WSAD 4.0.2
Francisco
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The syntax for a parameter in EJBQL is ? followed by the number of your parameter starting at 1.
Therefore your parameters would be ?1 and ?2. Unfortunately EJBQL in EJB 2.0 does not support date comparisons so you may be out of luck with your method.
For a more detailed description (ie I am too lazy to write a decent post) get a good book on EJB 2.0 or check out Rick Hightower's tutorials. I am too lazy to cut and paste the links but I am sure Rick can help you out in that department .
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there any other way to get around the problem? besides using bmp entity beans

Ras
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how can we select maximum value from database in ejbql? i think query select max(value).... is not supported by weblogic 6.1
 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
see this
http://www.onjava.com/pub/a/onjava/2001/09/19/ejbql.html
 
Chris Mathews
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Manish Kamat:
how can we select maximum value from database in ejbql? i think query select max(value).... is not supported by weblogic 6.1


This is not supported in EJB 2.0, though many vendors give this capability in a non-standard way.
These extensions should make their way into EJBQL in EJB 2.1, however that will not be finalized until sometime around August. Then we will still need to wait until vendor implementations start popping up.
reply
    Bookmark Topic Watch Topic
  • New Topic