Enterprise Technologies

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Learning EJB: stuck with CMP; EJB-QL error

    3 answers - 732 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    I am trying to create a simple CMP entity bean (no relationships or anything)

    that will access an existing table in an Oracle database.

    I've used the "capture-schema" tool and it generated a ".dbschema" file.

    I've got this .dbschema in the Jar file for the entity bean.

    My Home class defines a methodpublic Collection findByType(int type) throws ...;

    So I have a "remote finder method" defined for my entity bean for which I have the EB-QL

    "select distinct object(x) from Table1 as x where x.itype = ?1"

    When I try to deploy, I get an error

    JDO75313: Identifier 'Table1' does not denote an abstract schema'

    -

    What am I doing wrong? What have I ommitted?

  • No.1 | | 160 bytes | |

    I believe the error is indicating that when you packaged your EJB, you did not declare and abstract-schema-element with a value of Table1 .
  • No.2 | | 937 bytes | |

    Information provided in the .dbschema file which is packaged as part of the ejb.jar contains database metadata used for mapping and execution.This is different than the error you receive during deployment while trying to parse the EJB QL query.EJB QL uses abstract persistence schemas of entity beans for its data model. For CMP 2.0 entity beans, abstract schema names are specified in the abstract-schema-name element in the deployment descriptor for the EJB to denote entity bean abstract schema types in EJB-QL.

    It appears as though you are missing this in your deployment desriptor or if you have one defined, the query needs to reflect it.

    <cmp-version>2.x</cmp-version>

    <abstract-schema-name>Table1</abstract-schema-name>

    If you have something other than Table1 here, change the query to:

    Select Distinct Object(x) From SOMETHINGELSE AS x where x.type = ?1

  • No.3 | | 225 bytes | |

    Thanks for the pointers; I extracted the jar file from the ear and found thefields you mentioned - I must have entered data wrongly when usingdeploytool and the abstract schema field name was wrong

Re: Learning EJB: stuck with CMP; EJB-QL error


max 4000 letters.
Your nickname that display:
In order to stop the spam: 8 + 7 =
QUESTION ON "Enterprise Technologies"

JAVA TECH