• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in getting Max value of row element through EJB-QL.....

 
Pras Tiwari
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I ve written following Doclet's in my beans implementation class
=========
/**
* @ejb.finder
* signature = "CartMaster findmaxid()"
* method-intf = "Home"
* query = "SELECT MAX(cms.cartid) FROM EmployeeMaster as cms"
*/
======
When I build my application using XDOClet is build successfully & deployed Successfully under JBOSS 4.0.3
But Problem is that when I invoke my client Program containg code for Accesing findmaxid() method as follows:-
===========
Employeemaster E1=null;
Employeemaster E1=home.findmaxid();
================

It gives me error like
=============
Cannot create CDBean: javax.ejb.FinderException: Find failed: java.sql.SQLException: Got a java.lang.String[cl=0, value=S0000105] while looking for a Beans.interfaces.EmployeeMaster[cl=18074979]
=============

Pls tell me where i m wrong.

Thanx,
Prash
 
Scott Selikoff
author
Bartender
Posts: 4033
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What version of EJB does that use? I know that in earlier ones, EJB QL was severely limited.
 
Pras Tiwari
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using it for EJB CMP 2.0 specification. Also I heard that insted of Finder methods Select methods in EJB-QL will be used for finding Max Value. Is it right??? If yes then how to use it in XDOCLet for above Query?
I used it as follows but still not working.
=========
* @ejb.select query = "SELECT MAX(cms.totalvalue) FROM CartMaster AS cms"
* Signature ="Double ejbSelectmaxid()"
* result-type-mapping="Local"
=========
 
Sunil Dixit
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Prashant,
You need to use EJB 2.1 Spec. coz these functions are introduce in EJB2.1 as EQL enhancement.
Thanks
Sunil Dixit
[ January 22, 2006: Message edited by: Sunil Dixit ]
 
Pras Tiwari
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

But finder methods are working fine only problem is with Select methods.
Also if i want 2 change spec to 2.1 then how to do it??? where modification shld b done???
Thanx,
Prash
 
Pras Tiwari
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And also this these are clas level tags of XDOclet in My bean implementation Class:-
===========
* @ejb.bean name="CartMaster"
* display-name="Name for ent1"
* description="Description for ent1"
* jndi-name="ejb/CartMaster"
* type="CMP"
* cmp-version="2.x"
* view-type="both"
* @ejb.select query = "SELECT MAX(cms.totalvalue) FROM CartMaster AS cms"
* Signature ="Double ejbSelectmaxid()"
* result-type-mapping="none"
===========

It is having tag:-
cmp-version="2.x"

It is for 2.0 as well as 2.1. whether it will work???

Thax,
Prash
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!