Skip to Content
0
Former Member
Jun 24, 2010 at 09:41 AM

Named query exception JPA

10 Views

Hello

I wrote a simple named query in my entity class which is throwing me an exception.

@NamedQueries({

@NamedQuery(name="custrecords",query="SELECT c FROM CustDetails c WHERE lower(c.customerName) = :customerName"),

@NamedQuery(name="allcustrecords",query="SELECT c FROM CustDetails c")

})

Exception in defaultTrace.trc file:

The generated SQL statement is not valid for the underlying database platform (platform no. 99). For more details see attached exception. SQL statement is SELECT "C"."CUSTOMER_NO" "C_CUSTOMER_NO_customerNo","C"."CUSTOMER_NAME" "C_CUSTOMER_NAME_customerName","C"."STREET_1" "C_STREET_1_street1","C"."BUILDING_NAME" "C_BUILDING_NAME_buildingName","C"."CONTACT_NAME" "C_CONTACT_NAME_contactName","C"."POST_CODE" "C_POST_CODE_postCode","C"."CREDIT_LIMIT" "C_CREDIT_LIMIT_creditLimit","C"."COMPANY_REGN_NO" "DISPLAY_1","C"."COUNTRY" "C_COUNTRY_country","C"."VAT_REGN_NO" "C_VAT_REGN_NO_vatRegnNo" FROM "TMP_CUST_DETAILS" "C" WHERE LOWER("C"."CUSTOMER_NAME") = ?#

..............................................

.............................................

com.sap.engine.lib.injection.InjectionException: Injection on field em of instance com.centrica.scv.service.CustomerBean@1d53bb failed. Could not get a value to be injected from the factory.

I am using MAX DB.

Can some one tell me how to resolve this.

Thanks

Vidyadhar