JBoss.org Community Documentation

12.6.3. Overriding the EJB-QL to SQL Mapping

The EJB-QL query can be overridden in the jbosscmp-jdbc.xml file. The finder or select is still required to have an EJB-QL declaration, but the ejb-ql element can be left empty. Currently the SQL can be overridden with JBossQL, DynamicQL, DeclaredSQL or a BMP style custom ejbFind method. All EJB-QL overrides are non-standard extensions to the EJB specification, so use of these extensions will limit portability of your application. All of the EJB-QL overrides, except for BMP custom finders, are declared using a query element in the jbosscmp-jdbc.xml file. The content model is shown in Figure 12.11, “The jbosscmp-jdbc query element content model”.

The jbosscmp-jdbc query element content model

Figure 12.11. The jbosscmp-jdbc query element content model