Thread View: weblogic.developer.interest.ejb.cmp
1 messages
1 total messages
Started by Steve Lewis
Thu, 12 Aug 2004 22:59
need help with ejbSelect returning all instances of a field
Author: Steve Lewis
Date: Thu, 12 Aug 2004 22:59
Date: Thu, 12 Aug 2004 22:59
51 lines
2541 bytes
2541 bytes
I am having a lot trouble generating a simple EJB-QL query to return
one attribute from all objects in a table
In the header I say
* @ejb.bean name="MlbTeam"
jndi-name="com.babel17.fbdraft.bean.MlbTeam"
* type="CMP" primkey-field="teamId" schema="MlbTeam"
* cmp-version="2.x" data-source="java:/FBDraft"
*
* @ejb.finder query="SELECT OBJECT(a) FROM MlbTeam as a"
* signature="java.util.Collection findAll()"
The finder works
I have an attribute teamName
I say
/**
* <!-- begin-user-doc -->
* Return the names of all teams -
* Sample home method
* <!-- end-user-doc -->
* @ejb.home-method
*/
public String[] ejbHomeGetTeamNames() throws EJBException
{
try {
Collection items = this.ejbSelectTeamNames();
String[] ret = (String[])items.toArray(new String[0]);
return ret;
}
catch(FinderException ex) {
throw new EJBException(ex);
}
}
/**
*
* @ejb.select
* query="SELECT DISTINCT team.teamName FROM MlbTeam AS team"
* result-type-mapping="Local"
*/
public abstract Collection ejbSelectTeamNames()
throws FinderException;
WHen I run i get an error saying t0_a.teamname does not exist
I am running as a home method
I have also tried
SELECT team.teamName FROM MlbTeam AS team
and
SELECT team.teamName FROM MlbTeam team
What am I doing wrong??????
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads