<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Exceptions when annotated named query is applied and executed in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405622#M1031055</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Robin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;Regarding to the JPQL-grammer (spec 4.14) you are not allowed to compare &lt;/P&gt;&lt;P&gt;&amp;gt;with the non-terminal embeddable field&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What document are you refering to exactly - Can you provide a resource link&lt;/P&gt;&lt;P&gt;for me?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After solving the issue with the TimeSlice class I'm having trouble with Day class&lt;/P&gt;&lt;P&gt;which is exactly the same issue as with the TimeSlice class but anyhow I'm not&lt;/P&gt;&lt;P&gt;able to figure out what's going wrong there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Day class contains a field named calendar used for internal storage.&lt;/P&gt;&lt;P&gt;I tried to use the same approach as for the TimeSlice class.&lt;/P&gt;&lt;P&gt;My SapUserData class has a field of Type Day called dayOfAggregation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The query now looks like that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;                @NamedQuery(name = SapUserDataContext.NAMED_QUERY_NAME_COUNT_QUERY,
                            query = "SELECT COUNT(obj) FROM SapUserData AS obj WHERE "
                                     + "obj.sapCustomerId"
                                     + "= :" 
                                     + SapResultDataContext.COLUMN_NAME_SAP_CUSTOMER_ID
                                     + " AND "
                                     + "obj.sapSystemId"
                                     + "= :"
                                     + SapResultDataContext.COLUMN_NAME_SAP_SYSTEM_ID
                                     + " AND "
                                     + "obj.sapServerId"
                                     + "= :"
                                     + SapResultDataContext.COLUMN_NAME_SAP_SERVER_ID
                                     + " AND "
                                     + "obj.dayOfAggregation.calendar"
                                     + "= :"
                                     + DayContext.COLUMN_NAME_DAY_OF_AGGREGATION
                                     + " AND "
                                     + "obj.timeSlice.startTime"
                                     + "= :"
                                     + "timeSliceStartTime"
                                     + " AND "
                                     + "obj.timeSlice.endTime"
                                     + "= :"
                                     + "timeSliceEndTime"),&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I'm using the same way to access the calendar field like I'm accessing the &lt;/P&gt;&lt;P&gt;startTime and endTime fields of class TimeSlice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;                                     + "obj.dayOfAggregation.calendar"
                                     + "= :"
                                     + DayContext.COLUMN_NAME_DAY_OF_AGGREGATION&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Despite that fact NetWeaver still complains:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;[EXCEPTION]
 {0}#1#java.lang.IllegalArgumentException: line 1: Comparison '=' not defined for dependent objects
SELECT COUNT(obj) FROM SapUserData AS obj WHERE obj.sapCustomerId= :sap_customer_id AND obj.sapSystemId= :sap_system_id AND obj.sapServerId= :sap_server_id AND obj.dayOfAggregation.calendar= :day_of_aggregation AND obj.timeSlice.startTime= :timeSliceStartTime AND obj.timeSlice.endTime= :timeSliceEndTime
                                                                                ^&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The calendar field is of type Calendar - is there anything special about Calendar &lt;/P&gt;&lt;P&gt;objects?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I changed all named queries to be standard compliant and they do run prefectly&lt;/P&gt;&lt;P&gt;on both application servers - except the part of the &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;obj.dayOfAggregation.calendar&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;part in the query - It only runs on JBoss application server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to admit that it might be a problem of not seeing the trees because of the forrest but I'm stuck on it and don't know what NetWeaver complains about &lt;/P&gt;&lt;P&gt;because it's the same thing as with the TimeSlice class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Henning&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 23 Jun 2007 09:18:26 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-23T09:18:26Z</dc:date>
    <item>
      <title>Exceptions when annotated named query is applied and executed</title>
      <link>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaq-p/2405610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Forum,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have some problems in creating and using named queries declared via&lt;/P&gt;&lt;P&gt;class level annotations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I declared the following named query:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[code]@NamedQueries({&lt;/P&gt;&lt;P&gt;                @NamedQuery(name = SapUserDataContext.NAMED_QUERY_NAME_COUNT_QUERY,&lt;/P&gt;&lt;P&gt;                            query = "SELECT COUNT(obj.databaseId) FROM SapUserData AS obj WHERE "&lt;/P&gt;&lt;P&gt;                                     + "obj.sapCustomerId"&lt;/P&gt;&lt;P&gt;                                     + "= :" &lt;/P&gt;&lt;P&gt;                                     + SapResultDataContext.COLUMN_NAME_SAP_CUSTOMER_ID&lt;/P&gt;&lt;P&gt;                                     + " AND "&lt;/P&gt;&lt;P&gt;                                     + "obj.sapSystemId"&lt;/P&gt;&lt;P&gt;                                     + "= :"&lt;/P&gt;&lt;P&gt;                                     + SapResultDataContext.COLUMN_NAME_SAP_SYSTEM_ID&lt;/P&gt;&lt;P&gt;                                     + " AND "&lt;/P&gt;&lt;P&gt;                                     + "obj.sapServerId"&lt;/P&gt;&lt;P&gt;                                     + "= :"&lt;/P&gt;&lt;P&gt;                                     + SapResultDataContext.COLUMN_NAME_SAP_SERVER_ID&lt;/P&gt;&lt;P&gt;                                     + " AND "&lt;/P&gt;&lt;P&gt;                                     + "obj.dayOfAggregation"&lt;/P&gt;&lt;P&gt;                                     + "= :"&lt;/P&gt;&lt;P&gt;                                     + DayContext.COLUMN_NAME_DAY_OF_AGGREGATION&lt;/P&gt;&lt;P&gt;                                     + " AND "&lt;/P&gt;&lt;P&gt;                                     + "obj.timeSlice"&lt;/P&gt;&lt;P&gt;                                     + "= :"&lt;/P&gt;&lt;P&gt;                                     + TimeSliceContext.COLUMN_NAME_TIME_SLICE),&lt;/P&gt;&lt;P&gt;                                     })&lt;/P&gt;&lt;P&gt;public class SapUserData extends AbstractSapUserData {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;}[/code]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When executing that query I encounter the following errors:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[code][EXCEPTION]&lt;/P&gt;&lt;P&gt; &lt;SPAN __jive_macro_name="0"&gt;&lt;/SPAN&gt;#1#java.lang.IllegalArgumentException: line 1: Comparison '=' not defined for dependent objects&lt;/P&gt;&lt;P&gt;SELECT COUNT(obj.databaseId) FROM SapUserData AS obj WHERE obj.sapCustomerId= :sap_customer_id AND obj.sapSystemId= :sap_system_id AND obj.sapServerId= :sap_server_id AND obj.dayOfAggregation= :day_of_aggregation AND obj.timeSlice= :time_slice&lt;/P&gt;&lt;P&gt;                                                                                ^&lt;/P&gt;&lt;P&gt;line 1: Path 'obj' (SapUserData) has no component 'timeSlice'&lt;/P&gt;&lt;P&gt;SELECT COUNT(obj.databaseId) FROM SapUserData AS obj WHERE obj.sapCustomerId= :sap_customer_id AND obj.sapSystemId= :sap_system_id AND obj.sapServerId= :sap_server_id AND obj.dayOfAggregation= :day_of_aggregation AND obj.timeSlice= :time_slice&lt;/P&gt;&lt;P&gt;                                                                                ^&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;	at com.sap.engine.lib.orpersistence.ejbqlparser.JPQLParserFacade.parseJQPL(JPQLParserFacade.java:30)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.orpersistence.query.QueryImpl.calculateJPQLQueryData(QueryImpl.java:102)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.orpersistence.query.QueryImpl.precompileQueries(QueryImpl.java:83)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.orpersistence.entitymanager.EntityManagerFactoryImpl$MetaDataImpl.&amp;lt;init&amp;gt;(EntityManagerFactoryImpl.java:153)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.orpersistence.entitymanager.EntityManagerFactoryImpl.getPersistenceUnitData(EntityManagerFactoryImpl.java:124)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.orpersistence.core.PersistenceContextImpl.&amp;lt;init&amp;gt;(PersistenceContextImpl.java:69)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.orpersistence.entitymanager.EntityManagerImpl.&amp;lt;init&amp;gt;(EntityManagerImpl.java:71)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.orpersistence.entitymanager.JtaEntityManagerFactoryImpl.createEntityManagerInternal(JtaEntityManagerFactoryImpl.java:57)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.orpersistence.entitymanager.JtaEntityManagerFactoryImpl.createEntityManager(JtaEntityManagerFactoryImpl.java:49)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.orpersistence.container.EMManager.createEntityManager(EMManager.java:202)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.orpersistence.container.EMManager.getTransactionEntityManager(EMManager.java:60)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.orpersistence.container.EntityManagerProxy.getEntityManager(EntityManagerProxy.java:241)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.orpersistence.container.EntityManagerProxy.createNamedQuery(EntityManagerProxy.java:153)&lt;/P&gt;&lt;P&gt;	at de.collogia.sapmon.worker.beans.service.user.SapCurrentUsersServiceBean.checkRecordExistence(SapCurrentUsersServiceBean.java:233)&lt;/P&gt;&lt;P&gt;	at de.collogia.sapmon.worker.beans.service.user.SapCurrentUsersServiceBean.storeCurrentUserList(SapCurrentUsersServiceBean.java:109)&lt;/P&gt;&lt;P&gt;	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)&lt;/P&gt;&lt;P&gt;	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)&lt;/P&gt;&lt;P&gt;	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)&lt;/P&gt;&lt;P&gt;	at java.lang.reflect.Method.invoke(Method.java:585)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceed(RequestInvocationContext.java:43)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext$InvocationContextImpl.proceed(AbstractInvocationContext.java:131)&lt;/P&gt;&lt;P&gt;	at de.collogia.sapmon.worker.beans.interceptors.SapmonInterceptorLogServiceExecMethodStore.logServiceExecution(SapmonInterceptorLogServiceExecMethodStore.java:79)&lt;/P&gt;&lt;P&gt;	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)&lt;/P&gt;&lt;P&gt;	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)&lt;/P&gt;&lt;P&gt;	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)&lt;/P&gt;&lt;P&gt;	at java.lang.reflect.Method.invoke(Method.java:585)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Application.invoke(Interceptors_Application.java:34)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:168)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceed(RequestInvocationContext.java:85)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatesTransition.invoke(Interceptors_StatesTransition.java:19)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:168)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceed(RequestInvocationContext.java:85)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Resource.invoke(Interceptors_Resource.java:23)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:168)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceed(RequestInvocationContext.java:85)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.doWorkWithAttribute(Interceptors_Transaction.java:38)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.invoke(Interceptors_Transaction.java:22)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:168)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceed(RequestInvocationContext.java:85)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatelessInstanceGetter.invoke(Interceptors_StatelessInstanceGetter.java:16)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:168)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceed(RequestInvocationContext.java:85)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.Interceptors_SecurityCheck.invoke(Interceptors_SecurityCheck.java:21)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:168)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceed(RequestInvocationContext.java:85)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.Interceptors_ExceptionTracer.invoke(Interceptors_ExceptionTracer.java:16)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:168)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceed(RequestInvocationContext.java:85)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.DefaultInvocationChainsManager.startChain(DefaultInvocationChainsManager.java:133)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:164)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.RemoteEJBProxyInvocationHandler.invoke(RemoteEJBProxyInvocationHandler.java:46)&lt;/P&gt;&lt;P&gt;	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)&lt;/P&gt;&lt;P&gt;	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)&lt;/P&gt;&lt;P&gt;	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)&lt;/P&gt;&lt;P&gt;	at java.lang.reflect.Method.invoke(Method.java:585)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.rmi_p4.P4DynamicSkeleton.dispatch(P4DynamicSkeleton.java:237)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:253)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.rmi_p4.P4Message.execute(P4Message.java:109)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.cross.fca.FCAConnectorImpl.executeRequest(FCAConnectorImpl.java:841)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:125)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.cross.fca.MessageReader.run(MessageReader.java:59)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.core.thread.execution.Executable.run(Executable.java:108)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:168)[/code]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The main problem is that I'm unable to write the named query in a way that is &lt;/P&gt;&lt;P&gt;accepted by JBoss app. server and SAP NetWeaver app. server which&lt;/P&gt;&lt;P&gt;is an important fact because we are doing cross platform development.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On JBoss I'm able to write the query using the physical column names for both - &lt;/P&gt;&lt;P&gt;the field name I want to include in the where clause and for the named query parameter associated with the current field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the query working perfectly on JBoss lokks like that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[code]@NamedQueries({&lt;/P&gt;&lt;P&gt;                @NamedQuery(name = SapTaskDataContext.NAMED_QUERY_NAME_COUNT_QUERY,&lt;/P&gt;&lt;P&gt;                            query = "SELECT COUNT(*) FROM SapUserData AS obj WHERE "&lt;/P&gt;&lt;P&gt;                                     + SapResultDataContext.COLUMN_NAME_SAP_CUSTOMER_ID&lt;/P&gt;&lt;P&gt;                                     + "= :" &lt;/P&gt;&lt;P&gt;                                     + SapResultDataContext.COLUMN_NAME_SAP_CUSTOMER_ID&lt;/P&gt;&lt;P&gt;                                     + " AND "&lt;/P&gt;&lt;P&gt;                                     + SapResultDataContext.COLUMN_NAME_SAP_SYSTEM_ID&lt;/P&gt;&lt;P&gt;                                     + "= :"&lt;/P&gt;&lt;P&gt;                                     + SapResultDataContext.COLUMN_NAME_SAP_SYSTEM_ID&lt;/P&gt;&lt;P&gt;                                     + " AND "&lt;/P&gt;&lt;P&gt;                                     + SapResultDataContext.COLUMN_NAME_SAP_SERVER_ID&lt;/P&gt;&lt;P&gt;                                     + "= :"&lt;/P&gt;&lt;P&gt;                                     + SapResultDataContext.COLUMN_NAME_SAP_SERVER_ID&lt;/P&gt;&lt;P&gt;                                     + " AND "&lt;/P&gt;&lt;P&gt;                                     + DayContext.COLUMN_NAME_DAY_OF_AGGREGATION&lt;/P&gt;&lt;P&gt;                                     + "= :"&lt;/P&gt;&lt;P&gt;                                     + DayContext.COLUMN_NAME_DAY_OF_AGGREGATION&lt;/P&gt;&lt;P&gt;                                     + " AND "&lt;/P&gt;&lt;P&gt;                                     + TimeSliceContext.COLUMN_NAME_TIME_SLICE&lt;/P&gt;&lt;P&gt;                                     + "= :"&lt;/P&gt;&lt;P&gt;                                     + TimeSliceContext.COLUMN_NAME_TIME_SLICE),&lt;/P&gt;&lt;P&gt;               })&lt;/P&gt;&lt;P&gt;public class SapUserData extends AbstractSapUserData {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;}[/code]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The main difference is that I'm using the physical column name for referencing&lt;/P&gt;&lt;P&gt;the fields:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[code]                            query = "SELECT COUNT(*) FROM SapUserData AS obj WHERE "&lt;/P&gt;&lt;P&gt;                                     + SapResultDataContext.COLUMN_NAME_SAP_CUSTOMER_ID  &amp;lt;-- Physical column name used to reference the field&lt;/P&gt;&lt;P&gt;                                     + "= :" &lt;/P&gt;&lt;P&gt;                                     + SapResultDataContext.COLUMN_NAME_SAP_CUSTOMER_ID&amp;lt;-- Physical column name used to declare the named query parameter also[/code]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've chosen that way because JBoss complains when using the real field names&lt;/P&gt;&lt;P&gt;within named queries:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[code]12:35:57,962 WARN  [FromElementType] Using non-qualified column reference [sapCustomerId -&amp;gt; ([sap_customer_id])]&lt;/P&gt;&lt;P&gt;12:35:57,963 WARN  [FromElementType] Using non-qualified column reference [sapSystemId -&amp;gt; ([sap_system_id])]&lt;/P&gt;&lt;P&gt;12:35:57,963 WARN  [FromElementType] Using non-qualified column reference [sapServerId -&amp;gt; ([sap_server_id])]&lt;/P&gt;&lt;P&gt;12:35:57,963 WARN  [FromElementType] Using non-qualified column reference [dayOfAggregation -&amp;gt; ([day_of_aggregation,weekday])][/code]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The main problem I have ist that I'm unsure about what is most close to the EJB 3.0/ JPA 1.0 standards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The other problem is that both app servers are unable to reference the field&lt;/P&gt;&lt;P&gt;timeSlice when using the named query declaration that is accepted by&lt;/P&gt;&lt;P&gt;the NetWeaver app. server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[code]line 1: Path 'obj' (SapUserData) has no component 'timeSlice'&lt;/P&gt;&lt;P&gt;SELECT COUNT(obj.databaseId) FROM SapUserData AS obj WHERE obj.sapCustomerId= :sap_customer_id AND obj.sapSystemId= :sap_system_id AND obj.sapServerId= :sap_server_id AND obj.dayOfAggregation= :day_of_aggregation AND obj.timeSlice= :time_slice&lt;/P&gt;&lt;P&gt;                                                                                ^[/code]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it correct if I assume that this error is related to the fact that the timeSlice field&lt;/P&gt;&lt;P&gt;is declared as private member in the base class (AbstractSapUserData) of &lt;/P&gt;&lt;P&gt;class SapUserData?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another problem is the declaration of the query using the asterisk that is accepted&lt;/P&gt;&lt;P&gt;on JBoss:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[code]                            query = "SELECT COUNT(*) FROM SapUserData AS obj WHERE "[/code]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The EJBQL allows the usage of [code]COUNT(*)[/code] so far as I know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what's the point?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it's standard compliant I would prefer the named query syntax that works on JBoss because I'm allowed to use the constants defined in the Interface of &lt;/P&gt;&lt;P&gt;the class. The constant named of that interface are used to declare the physical column names on the get methods of the fields using the @Column(..) annotation&lt;/P&gt;&lt;P&gt;so it would be very nice to be able to use them within the naemd query definitions.&lt;/P&gt;&lt;P&gt;If I have to do it the NetWeaver way I end up with hard coded strings for the field &lt;/P&gt;&lt;P&gt;names which is not so smart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The fact I do not like at most is the fact that I'm unable to use base class fields in the query - I tried to change the field visibility form private to protected but I'm&lt;/P&gt;&lt;P&gt;still receiving the following exception:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[code]line 1: Path 'obj' (SapUserData) has no component 'timeSlice'&lt;/P&gt;&lt;P&gt;SELECT COUNT(obj.databaseId) FROM SapUserData AS obj WHERE obj.sapCustomerId= :sap_customer_id AND obj.sapSystemId= :sap_system_id AND obj.sapServerId= :sap_server_id AND obj.dayOfAggregation= :day_of_aggregation AND obj.timeSlice= :time_slice&lt;/P&gt;&lt;P&gt;                                                                                ^[/code]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas on that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Henning Malzahn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 10:33:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaq-p/2405610</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-22T10:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: Exceptions when annotated named query is applied and executed</title>
      <link>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405611#M1031044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Henning!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will try to answer your post in several parts.. &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Another problem is the declaration of the query using&lt;/P&gt;&lt;P&gt;&amp;gt; the asterisk that is accepted&lt;/P&gt;&lt;P&gt;&amp;gt; on JBoss:&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;                            query = "SELECT
&amp;gt; COUNT(*) FROM SapUserData AS obj WHERE "&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; The EJBQL allows the usage of &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;COUNT(*)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;gt; so far as I know.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; So what's the point?&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;According to the JPA Spec the usage of COUNT is only allowed in conjunction with a path-expression or an identification variable. Please refer to the spec chapter 4.8.4 and 4.14 for further information. Regarding JBoss I can say that they are not that strictly bound to the standard as our implementation because the JPA implementation of JBoss is Hibernate which internally uses HQL. The HQL-grammar is a superset of JPQL. Hence you can expect that such queries will also fail with other JPA implementations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Robin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 11:41:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405611#M1031044</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-22T11:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: Exceptions when annotated named query is applied and executed</title>
      <link>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405612#M1031045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Henning!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding your other problems it would be very helpful if you were able to post the code of the involved entities here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Robin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 11:45:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405612#M1031045</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-22T11:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: Exceptions when annotated named query is applied and executed</title>
      <link>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405613#M1031046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Henning!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; [code]@NamedQueries({&lt;/P&gt;&lt;P&gt;&amp;gt; @NamedQuery(name =&lt;/P&gt;&lt;P&gt;&amp;gt;  SapUserDataContext.NAMED_QUERY_NAME_COUNT_QUERY,&lt;/P&gt;&lt;P&gt;&amp;gt; query = "SELECT&lt;/P&gt;&lt;P&gt;&amp;gt; COUNT(obj.databaseId) FROM SapUserData AS obj WHERE&lt;/P&gt;&lt;P&gt;&amp;gt; "&lt;/P&gt;&lt;P&gt;&amp;gt; +&lt;/P&gt;&lt;P&gt;&amp;gt; "obj.sapCustomerId"&lt;/P&gt;&lt;P&gt;&amp;gt;                                      + "= :" &lt;/P&gt;&lt;P&gt;&amp;gt; + SapResultDataContext.COLUMN_NAME_SAP_CUSTOMER_ID&lt;/P&gt;&lt;P&gt;&amp;gt;                                      + " AND "&lt;/P&gt;&lt;P&gt;&amp;gt; + "obj.sapSystemId"&lt;/P&gt;&lt;P&gt;&amp;gt;                                      + "= :"&lt;/P&gt;&lt;P&gt;&amp;gt; + SapResultDataContext.COLUMN_NAME_SAP_SYSTEM_ID&lt;/P&gt;&lt;P&gt;&amp;gt;                                      + " AND "&lt;/P&gt;&lt;P&gt;&amp;gt; + "obj.sapServerId"&lt;/P&gt;&lt;P&gt;&amp;gt;                                      + "= :"&lt;/P&gt;&lt;P&gt;&amp;gt; + SapResultDataContext.COLUMN_NAME_SAP_SERVER_ID&lt;/P&gt;&lt;P&gt;&amp;gt;                                      + " AND "&lt;/P&gt;&lt;P&gt;&amp;gt; + "obj.dayOfAggregation"&lt;/P&gt;&lt;P&gt;&amp;gt;                                      + "= :"&lt;/P&gt;&lt;P&gt;&amp;gt; + DayContext.COLUMN_NAME_DAY_OF_AGGREGATION&lt;/P&gt;&lt;P&gt;&amp;gt;                                      + " AND "&lt;/P&gt;&lt;P&gt;&amp;gt; + "obj.timeSlice"&lt;/P&gt;&lt;P&gt;&amp;gt;                                      + "= :"&lt;/P&gt;&lt;P&gt;&amp;gt; + TimeSliceContext.COLUMN_NAME_TIME_SLICE),&lt;/P&gt;&lt;P&gt;&amp;gt;                                      })&lt;/P&gt;&lt;P&gt;&amp;gt; ractSapUserData {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As far as I understood you use the physical column names (the DB columns) in your named query. It is absolutely illegal to use DB column names in your object-oriented JPQL query. In my opinion this would totally undermine the spirit of JPA to mix up DB- and OO-stuff inside your queries. If you want to refer to DB columns please use named-native queries. This query might run on JBoss because the underlying JPA-implementation is Hibernate which might acceppt non-compliant JPQL queries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Robin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 11:53:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405613#M1031046</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-22T11:53:12Z</dc:date>
    </item>
    <item>
      <title>Re: Exceptions when annotated named query is applied and executed</title>
      <link>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405614#M1031047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Robin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you for that fast response!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;According to the JPA Spec the usage of COUNT is only allowed in conjunction &lt;/P&gt;&lt;P&gt;&amp;gt;with a path-expression or an identification variable. Please refer to the spec &lt;/P&gt;&lt;P&gt;&amp;gt;chapter 4.8.4 and 4.14 for further information. Regarding JBoss I can say that &lt;/P&gt;&lt;P&gt;&amp;gt;they are not that strictly bound to the standard as our implementation because &lt;/P&gt;&lt;P&gt;&amp;gt;the JPA implementation of JBoss is Hibernate which internally uses HQL. The &lt;/P&gt;&lt;P&gt;&amp;gt;HQL-grammar is a superset of JPQL. Hence you can expect that such queries &lt;/P&gt;&lt;P&gt;&amp;gt;will also fail with other JPA implementations.´&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for that hint - I think I messed up HQL and EJBQL definitions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So will use the following query:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;@NamedQueries({
                @NamedQuery(name = SapUserDataContext.NAMED_QUERY_NAME_COUNT_QUERY,
                            query = "SELECT COUNT(obj.databaseId) FROM SapUserData AS obj WHERE "
                                     + "obj.sapCustomerId"
                                     + "= :" 
                                     + SapResultDataContext.COLUMN_NAME_SAP_CUSTOMER_ID
                                     + " AND "
                                     + "obj.sapSystemId"
                                     + "= :"
                                     + SapResultDataContext.COLUMN_NAME_SAP_SYSTEM_ID
                                     + " AND "
                                     + "obj.sapServerId"
                                     + "= :"
                                     + SapResultDataContext.COLUMN_NAME_SAP_SERVER_ID
                                     + " AND "
                                     + "obj.dayOfAggregation"
                                     + "= :"
                                     + DayContext.COLUMN_NAME_DAY_OF_AGGREGATION
                                     + " AND "
                                     + "obj.timeSlice"
                                     + "= :"
                                     + TimeSliceContext.COLUMN_NAME_TIME_SLICE),
                                     })
public class SapUserData extends AbstractSapUserData {

    ...

}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But what about the following exception when using that query:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;[EXCEPTION]
 {0}#1#java.lang.IllegalArgumentException: line 1: Comparison '=' not defined for dependent objects
SELECT COUNT(obj.databaseId) FROM SapUserData AS obj WHERE obj.sapCustomerId= :sap_customer_id AND obj.sapSystemId= :sap_system_id AND obj.sapServerId= :sap_server_id AND obj.dayOfAggregation= :day_of_aggregation AND obj.timeSlice= :time_slice
                                                                                ^&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The field dayOfAggregation is defined as @Embedded object in the hierarchy&lt;/P&gt;&lt;P&gt;of that SapUserData class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The hierarchy is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
         @MappedSuperclass
         AbstractSapResultData (contains dayOfAggregation field)
                 ^
                 |
        @MappedSuperclass
        AbstractSapUserData (contains the timeSlice field)
                 ^
                 |
          @Entity
          SapUserData&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The get method for the field dayOfAggregation contained in class &lt;/P&gt;&lt;P&gt;AbstractSapResultData is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    /**
     * Get method for the member "&amp;lt;code&amp;gt;dayOfAggregation&amp;lt;/code&amp;gt;".
     * 
     * @return Returns the dayOfAggregation.
     */
    @Embedded
    @AttributeOverrides({@AttributeOverride(name = "calendar", /* Not possible to use interface constant here - field name must be used for reference */
                                            column = @Column(name = DayContext.COLUMN_NAME_DAY_OF_AGGREGATION, 
                                                             nullable = false)),
                         @AttributeOverride(name = "weekday", 
                                            column = @Column(name = DayContext.COLUMN_NAME_WEEKDAY, 
                                                             nullable = false)),
                       })
    public Day getDayOfAggregation() {
        return this.dayOfAggregation;
    }&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code of the get method for the timeSlice field contained in class &lt;/P&gt;&lt;P&gt;AbstractSapUserData is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    /**
     * Get method for the member "&amp;lt;code&amp;gt;timeSlice&amp;lt;/code&amp;gt;".
     * 
     * @return Returns the timeSlice.
     */
    @Embedded
    public TimeSlice getTimeslice() {
        return this.timeSlice;
    }&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using the obj.timeSlice field in the named query leads to the following exception:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;line 1: Path 'obj' (SapUserData) has no component 'timeSlice'
SELECT COUNT(obj.databaseId) FROM SapUserData AS obj WHERE obj.sapCustomerId= :sap_customer_id AND obj.sapSystemId= :sap_system_id AND obj.sapServerId= :sap_server_id AND obj.dayOfAggregation= :day_of_aggregation AND obj.timeSlice= :time_slice
                                                                                ^&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the problems are related to embedded fields declared in the base classes&lt;/P&gt;&lt;P&gt;that are annotated with @MappedSuperclass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry - Unfortunately I'm not allowed to post more code...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Henning&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 12:00:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405614#M1031047</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-22T12:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: Exceptions when annotated named query is applied and executed</title>
      <link>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405615#M1031048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Henning!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding your cross-platform development I would suggest that you firstly try to develop your application on our server which is strictly bound to the standard specifications. If you have it running on our Server there shouldn't be a problem to get it in a running state on JBoss which is not that strict and interprets the specs (at least in the JPA area) in a rather flexible way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Robin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 12:11:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405615#M1031048</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-22T12:11:08Z</dc:date>
    </item>
    <item>
      <title>Re: Exceptions when annotated named query is applied and executed</title>
      <link>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405616#M1031049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Regarding your cross-platform development I would&lt;/P&gt;&lt;P&gt;&amp;gt; suggest that you firstly try to develop your&lt;/P&gt;&lt;P&gt;&amp;gt; application on our server which is strictly bound to&lt;/P&gt;&lt;P&gt;&amp;gt; the standard specifications. If you have it running&lt;/P&gt;&lt;P&gt;&amp;gt; on our Server there shouldn't be a problem to get it&lt;/P&gt;&lt;P&gt;&amp;gt; in a running state on JBoss &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I definitely agree with that - but please note my previous post...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Henning&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 13:25:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405616#M1031049</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-22T13:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: Exceptions when annotated named query is applied and executed</title>
      <link>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405617#M1031050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I changed the get method of the timeSlice field to use the same annotations used&lt;/P&gt;&lt;P&gt;for the get method of field dayOfAggregation - so it now looks like that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[code]    /**&lt;/P&gt;&lt;P&gt;     &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get method for the member &amp;amp;quot;&amp;lt;code&amp;gt;timeSlice&amp;lt;/code&amp;gt;&amp;amp;quot;.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;@return Returns the timeSlice.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     */&lt;/P&gt;&lt;P&gt;    @Embedded&lt;/P&gt;&lt;P&gt;    @AttributeOverrides({@AttributeOverride(name = "timeSlice", /* Not possible to use interface constant here - field name must be used for reference */&lt;/P&gt;&lt;P&gt;                                            column = @Column(name = TimeSliceContext.COLUMN_NAME_TIME_SLICE,&lt;/P&gt;&lt;P&gt;                                                             length = TimeSliceContext.TIME_SLICE_STR_LEN,&lt;/P&gt;&lt;P&gt;                                                             nullable = false)),&lt;/P&gt;&lt;P&gt;                       })&lt;/P&gt;&lt;P&gt;    public TimeSlice getTimeslice() {&lt;/P&gt;&lt;P&gt;        return this.timeSlice;&lt;/P&gt;&lt;P&gt;    }[/code]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately I'm still receiving the following exception:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[code]#&lt;/P&gt;&lt;P&gt;#1.5 #0007E97510B5000C0000015B00000E34005B19B7C7A831A4#1182520052397#com.sap.engine.services.orpersistence.query.QueryImpl#collogia.de/sapmonWorker#com.sap.engine.services.orpersistence.query.QueryImpl#Guest#0#SAP J2EE Engine JTA Transaction : [02720ffffff9a00336]####Thread[RMI/IIOP Worker [0],5,Dedicated_Application_Thread]##0#0#Error#1#/System/EnterpriseServices/ORPersistence#Plain###An error occurred processing the named query &amp;gt;&amp;gt;countQuerySapUserData&amp;lt;&amp;lt; with the query string &amp;gt;&amp;gt;SELECT COUNT(obj) FROM SapUserData AS obj WHERE obj.sapCustomerId= :sap_customer_id AND obj.sapSystemId= :sap_system_id AND obj.sapServerId= :sap_server_id AND obj.dayOfAggregation= :day_of_aggregation AND obj.timeSlice= :time_slice&amp;lt;&amp;lt;. #&lt;/P&gt;&lt;P&gt;#1.5 #0007E97510B5000C0000015C00000E34005B19B7C7A831A4#1182520052397#com.sap.engine.services.orpersistence.query.QueryImpl#collogia.de/sapmonWorker#com.sap.engine.services.orpersistence.query.QueryImpl#Guest#0#SAP J2EE Engine JTA Transaction : [02720ffffff9a00336]####Thread[RMI/IIOP Worker [0],5,Dedicated_Application_Thread]##0#0#Error##Java###caught java.lang.IllegalArgumentException: line 1: Comparison '=' not defined for dependent objects&lt;/P&gt;&lt;P&gt;SELECT COUNT(obj) FROM SapUserData AS obj WHERE obj.sapCustomerId= :sap_customer_id AND obj.sapSystemId= :sap_system_id AND obj.sapServerId= :sap_server_id AND obj.dayOfAggregation= :day_of_aggregation AND obj.timeSlice= :time_slice&lt;/P&gt;&lt;P&gt;                                                                                ^&lt;/P&gt;&lt;P&gt;line 1: Path 'obj' (SapUserData) has no component 'timeSlice'&lt;/P&gt;&lt;P&gt;SELECT COUNT(obj) FROM SapUserData AS obj WHERE obj.sapCustomerId= :sap_customer_id AND obj.sapSystemId= :sap_system_id AND obj.sapServerId= :sap_server_id AND obj.dayOfAggregation= :day_of_aggregation AND obj.timeSlice= :time_slice&lt;/P&gt;&lt;P&gt;                                                                                ^&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;[EXCEPTION]&lt;/P&gt;&lt;P&gt; &lt;SPAN __jive_macro_name="0"&gt;&lt;/SPAN&gt;#1#java.lang.IllegalArgumentException: line 1: Comparison '=' not defined for dependent objects&lt;/P&gt;&lt;P&gt;SELECT COUNT(obj) FROM SapUserData AS obj WHERE obj.sapCustomerId= :sap_customer_id AND obj.sapSystemId= :sap_system_id AND obj.sapServerId= :sap_server_id AND obj.dayOfAggregation= :day_of_aggregation AND obj.timeSlice= :time_slice&lt;/P&gt;&lt;P&gt;                                                                                ^&lt;/P&gt;&lt;P&gt;line 1: Path 'obj' (SapUserData) has no component 'timeSlice'&lt;/P&gt;&lt;P&gt;SELECT COUNT(obj) FROM SapUserData AS obj WHERE obj.sapCustomerId= :sap_customer_id AND obj.sapSystemId= :sap_system_id AND obj.sapServerId= :sap_server_id AND obj.dayOfAggregation= :day_of_aggregation AND obj.timeSlice= :time_slice&lt;/P&gt;&lt;P&gt;                                                                                ^&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;	at com.sap.engine.lib.orpersistence.ejbqlparser.JPQLParserFacade.parseJQPL(JPQLParserFacade.java:30)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.orpersistence.query.QueryImpl.calculateJPQLQueryData(QueryImpl.java:102)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.orpersistence.query.QueryImpl.precompileQueries(QueryImpl.java:83)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.orpersistence.entitymanager.EntityManagerFactoryImpl$MetaDataImpl.&amp;lt;init&amp;gt;(EntityManagerFactoryImpl.java:153)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.orpersistence.entitymanager.EntityManagerFactoryImpl.getPersistenceUnitData(EntityManagerFactoryImpl.java:124)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.orpersistence.core.PersistenceContextImpl.&amp;lt;init&amp;gt;(PersistenceContextImpl.java:69)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.orpersistence.entitymanager.EntityManagerImpl.&amp;lt;init&amp;gt;(EntityManagerImpl.java:71)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.orpersistence.entitymanager.JtaEntityManagerFactoryImpl.createEntityManagerInternal(JtaEntityManagerFactoryImpl.java:57)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.orpersistence.entitymanager.JtaEntityManagerFactoryImpl.createEntityManager(JtaEntityManagerFactoryImpl.java:49)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.orpersistence.container.EMManager.createEntityManager(EMManager.java:202)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.orpersistence.container.EMManager.getTransactionEntityManager(EMManager.java:60)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.orpersistence.container.EntityManagerProxy.getEntityManager(EntityManagerProxy.java:241)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.orpersistence.container.EntityManagerProxy.createNamedQuery(EntityManagerProxy.java:153)&lt;/P&gt;&lt;P&gt;	at de.collogia.sapmon.worker.beans.service.user.SapCurrentUsersServiceBean.checkRecordExistence(SapCurrentUsersServiceBean.java:233)&lt;/P&gt;&lt;P&gt;	at de.collogia.sapmon.worker.beans.service.user.SapCurrentUsersServiceBean.storeCurrentUserList(SapCurrentUsersServiceBean.java:109)&lt;/P&gt;&lt;P&gt;	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)&lt;/P&gt;&lt;P&gt;	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)&lt;/P&gt;&lt;P&gt;	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)&lt;/P&gt;&lt;P&gt;	at java.lang.reflect.Method.invoke(Method.java:585)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceed(RequestInvocationContext.java:43)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext$InvocationContextImpl.proceed(AbstractInvocationContext.java:131)&lt;/P&gt;&lt;P&gt;	at de.collogia.sapmon.worker.beans.interceptors.SapmonInterceptorLogServiceExecMethodStore.logServiceExecution(SapmonInterceptorLogServiceExecMethodStore.java:79)&lt;/P&gt;&lt;P&gt;	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)&lt;/P&gt;&lt;P&gt;	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)&lt;/P&gt;&lt;P&gt;	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)&lt;/P&gt;&lt;P&gt;	at java.lang.reflect.Method.invoke(Method.java:585)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Application.invoke(Interceptors_Application.java:34)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:168)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceed(RequestInvocationContext.java:85)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatesTransition.invoke(Interceptors_StatesTransition.java:19)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:168)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceed(RequestInvocationContext.java:85)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Resource.invoke(Interceptors_Resource.java:23)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:168)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceed(RequestInvocationContext.java:85)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.doWorkWithAttribute(Interceptors_Transaction.java:38)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.invoke(Interceptors_Transaction.java:22)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:168)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceed(RequestInvocationContext.java:85)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatelessInstanceGetter.invoke(Interceptors_StatelessInstanceGetter.java:16)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:168)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceed(RequestInvocationContext.java:85)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.Interceptors_SecurityCheck.invoke(Interceptors_SecurityCheck.java:21)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:168)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceed(RequestInvocationContext.java:85)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.Interceptors_ExceptionTracer.invoke(Interceptors_ExceptionTracer.java:16)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:168)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceed(RequestInvocationContext.java:85)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.DefaultInvocationChainsManager.startChain(DefaultInvocationChainsManager.java:133)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:164)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.ejb3.runtime.impl.RemoteEJBProxyInvocationHandler.invoke(RemoteEJBProxyInvocationHandler.java:46)&lt;/P&gt;&lt;P&gt;	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)&lt;/P&gt;&lt;P&gt;	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)&lt;/P&gt;&lt;P&gt;	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)&lt;/P&gt;&lt;P&gt;	at java.lang.reflect.Method.invoke(Method.java:585)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.rmi_p4.P4DynamicSkeleton.dispatch(P4DynamicSkeleton.java:237)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:253)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.rmi_p4.P4Message.execute(P4Message.java:109)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.cross.fca.FCAConnectorImpl.executeRequest(FCAConnectorImpl.java:841)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:125)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.services.cross.fca.MessageReader.run(MessageReader.java:59)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.core.thread.execution.Executable.run(Executable.java:108)&lt;/P&gt;&lt;P&gt;	at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:168)[/code]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Henning&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 13:53:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405617#M1031050</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-22T13:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: Exceptions when annotated named query is applied and executed</title>
      <link>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405618#M1031051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Henning!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem here is that you compare an input-parameter with an embeddable field of your entity. Regarding to the JPQL-grammer (spec 4.14) you are not allowed to compare with the non-terminal embeddable field but with the terminal fields of your embeddable. Stating that your embedded class might have the fields startTime and endTime your JPQL query might look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Query q = em.createQuery("SELECT count(obj.databaseId) FROM SapUserData obj WHERE obj.timeSlice.startTime = :startTime AND obj.timeSlice.endTime = :endTime");

q.setParameter("startTime", foo.getStartTime());
q.setParameter("endTime", foo.getEndTime());
q.getResultList();
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This limitation in the JPQL grammar is rather uncomfortable. An automatic mapping of the parameter's fields to the terminal fields of your embedded field would be more convenient. The same can be said for lists as parameter-values which is possible in HQL, too. I think we have to wait patiently for JPA 2.0 and hope for improvements there. &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Robin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 14:01:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405618#M1031051</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-22T14:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: Exceptions when annotated named query is applied and executed</title>
      <link>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405619#M1031052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;right after posting I was able to spot the problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The class TimeSlice previously was named Timeslice.&lt;/P&gt;&lt;P&gt;During the refactoring process I didn't notice that I had forgotten to rename the&lt;/P&gt;&lt;P&gt;get and set methods of class AbstractSapResultData - it still used the &lt;/P&gt;&lt;P&gt;version with the lower case s.&lt;/P&gt;&lt;P&gt;So the problem was that the class TimeSlice defined the correctly refactored get and set Methods&lt;/P&gt;&lt;P&gt;getTimeSlice and setTimeSlice and AbstractSapResultData still used&lt;/P&gt;&lt;P&gt;getTimeslice and setTimeslice.&lt;/P&gt;&lt;P&gt;After correcting that the exception stating&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;line 1: Path 'obj' (SapUserData) has no component 'timeSlice'&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;disappeared.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I'm left with the following exception:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;#
#1.5 #0007E97510B5000B0000009400000E34005B19B7C7A7D7CA#1182521026906#System.err#collogia.de/sapmonWorker#System.err#Guest#0#SAP J2EE Engine JTA Transaction : [02720ffffff9a00367]####Thread[RMI/IIOP Worker [2],5,Dedicated_Application_Thread]##0#0#Error##Plain###Jun 22, 2007 4:03:46 PM de.collogia.sapmon.worker.beans.interceptors.SapmonInterceptorLogServiceExecMethodStore logServiceExecution
SEVERE: Exception raised from invocation of public void de.collogia.sapmon.worker.beans.service.user.SapCurrentUsersServiceBean.storeCurrentUserList(de.collogia.sapmon.configmgr.data.pojos.SapAccountShort,de.collogia.sapmon.configmgr.data.pojos.SapServerShort) throws de.collogia.sapmon.SapmonSapConnectivityException,de.collogia.sapmon.SapmonResultException,de.collogia.sapmon.SapmonServiceException method on bean instance de.collogia.sapmon.worker.beans.service.user.SapCurrentUsersServiceBean@24bf19 for bean collogia.de/sapmonWorker*annotation|sapmon-worker-0.1.0.jar*annotation|SapCurrentUsersServiceBean; nested exception is: java.lang.IllegalArgumentException: line 1: Comparison '=' not defined for dependent objects
SELECT COUNT(obj) FROM SapUserData AS obj WHERE obj.sapCustomerId= :sap_customer_id AND obj.sapSystemId= :sap_system_id AND obj.sapServerId= :sap_server_id AND obj.dayOfAggregation= :day_of_aggregation AND obj.timeSlice= :time_slice
                                                                                ^
line 1: Comparison '=' not defined for dependent objects
SELECT COUNT(obj) FROM SapUserData AS obj WHERE obj.sapCustomerId= :sap_customer_id AND obj.sapSystemId= :sap_system_id AND obj.sapServerId= :sap_server_id AND obj.dayOfAggregation= :day_of_aggregation AND obj.timeSlice= :time_slice
 &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Henning&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 14:06:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405619#M1031052</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-22T14:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: Exceptions when annotated named query is applied and executed</title>
      <link>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405620#M1031053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just check my last post. &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 14:11:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405620#M1031053</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-22T14:11:00Z</dc:date>
    </item>
    <item>
      <title>Re: Exceptions when annotated named query is applied and executed</title>
      <link>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405621#M1031054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Robin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you've been faster...&lt;/P&gt;&lt;P&gt;...and your guess was absolutely correct - The class has a startTime and endTime&lt;/P&gt;&lt;P&gt;field. And the query works like outlined in your post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the problem is that I don't want the fields startTime and endTime to become&lt;/P&gt;&lt;P&gt;persistent - so get methods of these fields shall be marked with @Transient.&lt;/P&gt;&lt;P&gt;I had to remove that annotation to get the query working and I also had to create&lt;/P&gt;&lt;P&gt;set methods for the two fields.&lt;/P&gt;&lt;P&gt;Any idea on solving that while keeping the fields transient?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Henning&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 14:27:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405621#M1031054</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-22T14:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: Exceptions when annotated named query is applied and executed</title>
      <link>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405622#M1031055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Robin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;Regarding to the JPQL-grammer (spec 4.14) you are not allowed to compare &lt;/P&gt;&lt;P&gt;&amp;gt;with the non-terminal embeddable field&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What document are you refering to exactly - Can you provide a resource link&lt;/P&gt;&lt;P&gt;for me?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After solving the issue with the TimeSlice class I'm having trouble with Day class&lt;/P&gt;&lt;P&gt;which is exactly the same issue as with the TimeSlice class but anyhow I'm not&lt;/P&gt;&lt;P&gt;able to figure out what's going wrong there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Day class contains a field named calendar used for internal storage.&lt;/P&gt;&lt;P&gt;I tried to use the same approach as for the TimeSlice class.&lt;/P&gt;&lt;P&gt;My SapUserData class has a field of Type Day called dayOfAggregation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The query now looks like that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;                @NamedQuery(name = SapUserDataContext.NAMED_QUERY_NAME_COUNT_QUERY,
                            query = "SELECT COUNT(obj) FROM SapUserData AS obj WHERE "
                                     + "obj.sapCustomerId"
                                     + "= :" 
                                     + SapResultDataContext.COLUMN_NAME_SAP_CUSTOMER_ID
                                     + " AND "
                                     + "obj.sapSystemId"
                                     + "= :"
                                     + SapResultDataContext.COLUMN_NAME_SAP_SYSTEM_ID
                                     + " AND "
                                     + "obj.sapServerId"
                                     + "= :"
                                     + SapResultDataContext.COLUMN_NAME_SAP_SERVER_ID
                                     + " AND "
                                     + "obj.dayOfAggregation.calendar"
                                     + "= :"
                                     + DayContext.COLUMN_NAME_DAY_OF_AGGREGATION
                                     + " AND "
                                     + "obj.timeSlice.startTime"
                                     + "= :"
                                     + "timeSliceStartTime"
                                     + " AND "
                                     + "obj.timeSlice.endTime"
                                     + "= :"
                                     + "timeSliceEndTime"),&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I'm using the same way to access the calendar field like I'm accessing the &lt;/P&gt;&lt;P&gt;startTime and endTime fields of class TimeSlice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;                                     + "obj.dayOfAggregation.calendar"
                                     + "= :"
                                     + DayContext.COLUMN_NAME_DAY_OF_AGGREGATION&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Despite that fact NetWeaver still complains:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;[EXCEPTION]
 {0}#1#java.lang.IllegalArgumentException: line 1: Comparison '=' not defined for dependent objects
SELECT COUNT(obj) FROM SapUserData AS obj WHERE obj.sapCustomerId= :sap_customer_id AND obj.sapSystemId= :sap_system_id AND obj.sapServerId= :sap_server_id AND obj.dayOfAggregation.calendar= :day_of_aggregation AND obj.timeSlice.startTime= :timeSliceStartTime AND obj.timeSlice.endTime= :timeSliceEndTime
                                                                                ^&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The calendar field is of type Calendar - is there anything special about Calendar &lt;/P&gt;&lt;P&gt;objects?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I changed all named queries to be standard compliant and they do run prefectly&lt;/P&gt;&lt;P&gt;on both application servers - except the part of the &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;obj.dayOfAggregation.calendar&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;part in the query - It only runs on JBoss application server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to admit that it might be a problem of not seeing the trees because of the forrest but I'm stuck on it and don't know what NetWeaver complains about &lt;/P&gt;&lt;P&gt;because it's the same thing as with the TimeSlice class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Henning&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Jun 2007 09:18:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405622#M1031055</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-23T09:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: Exceptions when annotated named query is applied and executed</title>
      <link>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405623#M1031056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Henning!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;[EXCEPTION]
&amp;gt; {0}#1#java.lang.IllegalArgumentException: line 1:
&amp;gt;  Comparison '=' not defined for dependent objects
&amp;gt; ELECT COUNT(obj) FROM SapUserData AS obj WHERE
&amp;gt; obj.sapCustomerId= :sap_customer_id AND
&amp;gt; obj.sapSystemId= :sap_system_id AND obj.sapServerId=
&amp;gt; :sap_server_id AND obj.dayOfAggregation.calendar=
&amp;gt; :day_of_aggregation AND obj.timeSlice.startTime=
&amp;gt; :timeSliceStartTime AND obj.timeSlice.endTime=
&amp;gt; :timeSliceEndTime
&amp;gt; 
&amp;gt; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; The calendar field is of type Calendar - is there&lt;/P&gt;&lt;P&gt;&amp;gt; anything special about Calendar &lt;/P&gt;&lt;P&gt;&amp;gt; objects?&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; I changed all named queries to be standard compliant&lt;/P&gt;&lt;P&gt;&amp;gt; and they do run prefectly&lt;/P&gt;&lt;P&gt;&amp;gt; on both application servers - except the part of the&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;obj.dayOfAggregation.calendar&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; part in the query - It only runs on JBoss application&lt;/P&gt;&lt;P&gt;&amp;gt; server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As far as I see it now we have an issue in the current version of the JPQL Parser regarding the comparison of single-persistent fields of type java.util.Calendar and input-parameters. I will work on a solution for this. As a workaround I recommend you to use Date and Time classes of the java.sql package for your entities and queries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding the specifation documents I suggest you to have a look at the following URL:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://jcp.org/aboutJava/communityprocess/final/jsr220/index.html" target="test_blank"&gt;http://jcp.org/aboutJava/communityprocess/final/jsr220/index.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Robin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2007 06:55:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405623#M1031056</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-25T06:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: Exceptions when annotated named query is applied and executed</title>
      <link>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405624#M1031057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Morning Robin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for the link to the spec. document.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get you right - the problem is a bug?&lt;/P&gt;&lt;P&gt;If so it is a bug on the SAP NetWeaver server only, right?&lt;/P&gt;&lt;P&gt;I''m asking because the query runs on JBoss as mentioned above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If that's the case I wait for a fix instead of re-designing my classes...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Henning&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2007 07:02:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405624#M1031057</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-25T07:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: Exceptions when annotated named query is applied and executed</title>
      <link>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405625#M1031058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Henning!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You're right, it is a bug and it is specific to Netweaver CE. I just tried to express it in a more positive way. &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt; Although it would only take a rather short time to fix the bug it might take a while until you get the version of Netweaver that contains this fix. As far as I know it will be contained in SAP NetWeaver Composition Environment 7.1 SP3 which will be generally available around the 3rd quarter 2007. I don't have any information if there will be a preview version available on SDN before that date. You should have this in mind when you decide on redesigning your classes or not. &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Robin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2007 09:02:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405625#M1031058</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-25T09:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: Exceptions when annotated named query is applied and executed</title>
      <link>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405626#M1031059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Robin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;I just tried to express it in a more positive way. &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Ok - not the fact I wanted to hear but thanks for the honest answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ugly enough to have two more columns in the db because of the TimeSlice class&lt;/P&gt;&lt;P&gt;and the startTime/ endTime problem - but I'm not going to rewrite my Day class.&lt;/P&gt;&lt;P&gt;I'l wait for the fixed version of the SAP NetWeaver.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope these things will be beautified in future JPA releases.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your efforts!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Henning Malzahn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2007 10:01:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405626#M1031059</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-25T10:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: Exceptions when annotated named query is applied and executed</title>
      <link>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405627#M1031060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Robin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one question left.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to figure out whether the fixed version will be available as preview.&lt;/P&gt;&lt;P&gt;This would be very nice because of the strict implementation of the SAP NetWeaver.&lt;/P&gt;&lt;P&gt;The other thing is that the title of my diploma work title includes:&lt;/P&gt;&lt;P&gt;"A unified implementation using EJB 3.0 for SAP NetWeaver and JBoss"...&lt;/P&gt;&lt;P&gt;... so it would be very nice to have the application up and running when&lt;/P&gt;&lt;P&gt;doing the final presentation for my professor...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Henning&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2007 10:16:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405627#M1031060</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-25T10:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: Exceptions when annotated named query is applied and executed</title>
      <link>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405628#M1031061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Henning!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After some research I can say that we will have future preview-versions of the Java Server available at SDN. However, I cannot tell any detailed dates. So I recommend you to stick with your current version and adjust your application. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Robin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jul 2007 08:09:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/exceptions-when-annotated-named-query-is-applied-and-executed/qaa-p/2405628#M1031061</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-02T08:09:58Z</dc:date>
    </item>
  </channel>
</rss>

