This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

EJBQL  RSS feed

 
Jose, Santos
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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).]
 
Marcos Maia
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
sunil seth
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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.
 
Francisco A Guimaraes
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • 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
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • 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 .
 
rastin purr
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any other way to get around the problem? besides using bmp entity beans

Ras
 
Manish Kamat
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • 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
 
Jaffery Rab
Ranch Hand
Posts: 36
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • 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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!