You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cayenne.apache.org by Lachlan Deck <la...@gmail.com> on 2010/01/24 23:51:13 UTC

EJBQL client-side challenge

Hi there,

ObjEntity.getDbEntityName() in ROP returns null as does DbEntity. I realise that the original reasoning for this was security but this presents a challenge for utilising EJBQL (or SQLTemplate for that matter) to some extent from ROP.

Two immediate problems:
- if the ROP code only knows the name of the ObjEntity this won't necessarily map to the same name in the DbEntity/ or table/view.
- same again goes for attribute names.
etc

Is it worth rethinking this for 3.1?

with regards,
--

Lachlan Deck


Re: EJBQL client-side challenge

Posted by Lachlan Deck <la...@gmail.com>.
On 28/01/2010, at 2:45 PM, Lachlan Deck wrote:

> On 27/01/2010, at 2:03 AM, Andrus Adamchik wrote:
> 
>> So do you have a stack trace of the error BTW?
> 
> Yep - apologies for the delay. See below.

Woops, looks like this was from a NamedQuery.

> with regards,
> --
> 
> Lachlan Deck
> 
> ObjEntity.name: AttachmentInfo
> DbEntity.name: BinaryInfo
> 
> --- from client ---
> ERROR ish.oncourse.cayenne.CayenneContext :453 - A fatal error has occurred in onCourse.
>     [java] org.apache.cayenne.CayenneRuntimeException: [v.3.0RC1 Dec 27 2009 11:39:09] [v.3.0RC1 Dec 27 2009 11:39:09] Exception processing message org.apache.cayenne.remote.QueryMessage of type Query
>     [java] 	at org.apache.cayenne.remote.service.BaseRemoteService.processMessage(BaseRemoteService.java:167)
>     [java] 	at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
>     [java] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     [java] 	at java.lang.reflect.Method.invoke(Method.java:597)
>     [java] 	at com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:180)
>     [java] 	at com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:109)
>     [java] 	at com.caucho.hessian.server.HessianServlet.service(HessianServlet.java:396)
>     [java] 	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
>     [java] 	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
>     [java] 	at ish.oncourse.server.SecurityFilter.doFilter(SecurityFilter.java:111)
>     [java] 	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
>     [java] 	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
>     [java] 	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
>     [java] 	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
>     [java] 	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
>     [java] 	at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
>     [java] 	at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
>     [java] 	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>     [java] 	at org.mortbay.jetty.Server.handle(Server.java:326)
>     [java] 	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
>     [java] 	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
>     [java] 	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:842)
>     [java] 	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
>     [java] 	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
>     [java] 	at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
>     [java] 	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
>     [java] Caused by: java.lang.Exception: Table/View 'ATTACHMENTINFO' does not exist.
>     [java] 	at org.apache.cayenne.remote.service.BaseRemoteService.processMessage(BaseRemoteService.java:160)
>     [java] 	... 25 more
> 
> --- from server ---
> INFO  org.apache.cayenne.remote.service.BaseRemoteService :156 - error processing message
>     [java] java.sql.SQLSyntaxErrorException: Table/View 'ATTACHMENTINFO' does not exist.
>     [java] 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
>     [java] 	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
>     [java] 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
>     [java] 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
>     [java] 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
>     [java] 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
>     [java] 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(Unknown Source)
>     [java] 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(Unknown Source)
>     [java] 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(Unknown Source)
>     [java] 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement40.<init>(Unknown Source)
>     [java] 	at org.apache.derby.jdbc.Driver40.newEmbedPreparedStatement(Unknown Source)
>     [java] 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
>     [java] 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
>     [java] 	at org.apache.cayenne.conn.ConnectionWrapper.prepareStatement(ConnectionWrapper.java:281)
>     [java] 	at org.apache.cayenne.conn.ConnectionWrapper.prepareStatement(ConnectionWrapper.java:287)
>     [java] 	at org.apache.cayenne.access.TransactionConnectionDecorator.prepareStatement(TransactionConnectionDecorator.java:186)
>     [java] 	at org.apache.cayenne.access.jdbc.SQLTemplateAction.execute(SQLTemplateAction.java:155)
>     [java] 	at org.apache.cayenne.access.jdbc.SQLTemplateAction.performAction(SQLTemplateAction.java:134)
>     [java] 	at org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:87)
>     [java] 	at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:269)
>     [java] 	at org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java:418)
>     [java] 	at org.apache.cayenne.access.DataDomainQueryAction.access$000(DataDomainQueryAction.java:65)
>     [java] 	at org.apache.cayenne.access.DataDomainQueryAction$2.transform(DataDomainQueryAction.java:391)
>     [java] 	at org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:850)
>     [java] 	at org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(DataDomainQueryAction.java:388)
>     [java] 	at org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:117)
>     [java] 	at org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:743)
>     [java] 	at org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:333)
>     [java] 	at org.apache.cayenne.util.ObjectContextQueryAction.execute(ObjectContextQueryAction.java:96)
>     [java] 	at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:1278)
>     [java] 	at org.apache.cayenne.access.ClientServerChannelQueryAction.runQuery(ClientServerChannelQueryAction.java:119)
>     [java] 	at org.apache.cayenne.access.ClientServerChannelQueryAction.execute(ClientServerChannelQueryAction.java:65)
>     [java] 	at org.apache.cayenne.access.ClientServerChannel.onQuery(ClientServerChannel.java:81)
>     [java] 	at org.apache.cayenne.remote.service.DispatchHelper.dispatch(DispatchHelper.java:39)
>     [java] 	at org.apache.cayenne.remote.service.BaseRemoteService.processMessage(BaseRemoteService.java:152)
>     [java] 	at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
>     [java] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     [java] 	at java.lang.reflect.Method.invoke(Method.java:597)
>     [java] 	at com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:180)
>     [java] 	at com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:109)
>     [java] 	at com.caucho.hessian.server.HessianServlet.service(HessianServlet.java:396)
>     [java] 	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
>     [java] 	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
>     [java] 	at ish.oncourse.server.SecurityFilter.doFilter(SecurityFilter.java:111)
>     [java] 	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
>     [java] 	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
>     [java] 	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
>     [java] 	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
>     [java] 	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
>     [java] 	at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
>     [java] 	at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
>     [java] 	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>     [java] 	at org.mortbay.jetty.Server.handle(Server.java:326)
>     [java] 	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
>     [java] 	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
>     [java] 	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:842)
>     [java] 	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
>     [java] 	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
>     [java] 	at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
>     [java] 	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
>     [java] Caused by: java.sql.SQLException: Table/View 'ATTACHMENTINFO' does not exist.
>     [java] 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
>     [java] 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
>     [java] 	... 60 more
>     [java] Caused by: ERROR 42X05: Table/View 'ATTACHMENTINFO' does not exist.
>     [java] 	at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
>     [java] 	at org.apache.derby.impl.sql.compile.FromBaseTable.bindTableDescriptor(Unknown Source)

with regards,
--

Lachlan Deck




Re: EJBQL client-side challenge

Posted by Lachlan Deck <la...@gmail.com>.
On 27/01/2010, at 2:03 AM, Andrus Adamchik wrote:

> On Jan 26, 2010, at 4:50 PM, Lachlan Deck wrote:
> 
>> Strictly speaking, yes. But you could also say that one is a derivative of the other. e.g., upper-casing camel casing and joined via underscore which is a common db mapping (which perhaps cayenne allows for, especially when reverse engineering).
> 
> No, Cayenne doesn't make any such adhoc conversions. So MT_TABLE and MtTable1 are different names, and the framework will not attempt a conversion.
> 
> So do you have a stack trace of the error BTW?

Yep - apologies for the delay. See below.

with regards,
--

Lachlan Deck

ObjEntity.name: AttachmentInfo
DbEntity.name: BinaryInfo

--- from client ---
ERROR ish.oncourse.cayenne.CayenneContext :453 - A fatal error has occurred in onCourse.
     [java] org.apache.cayenne.CayenneRuntimeException: [v.3.0RC1 Dec 27 2009 11:39:09] [v.3.0RC1 Dec 27 2009 11:39:09] Exception processing message org.apache.cayenne.remote.QueryMessage of type Query
     [java] 	at org.apache.cayenne.remote.service.BaseRemoteService.processMessage(BaseRemoteService.java:167)
     [java] 	at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
     [java] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [java] 	at java.lang.reflect.Method.invoke(Method.java:597)
     [java] 	at com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:180)
     [java] 	at com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:109)
     [java] 	at com.caucho.hessian.server.HessianServlet.service(HessianServlet.java:396)
     [java] 	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
     [java] 	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
     [java] 	at ish.oncourse.server.SecurityFilter.doFilter(SecurityFilter.java:111)
     [java] 	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
     [java] 	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
     [java] 	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
     [java] 	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
     [java] 	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
     [java] 	at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
     [java] 	at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
     [java] 	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
     [java] 	at org.mortbay.jetty.Server.handle(Server.java:326)
     [java] 	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
     [java] 	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
     [java] 	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:842)
     [java] 	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
     [java] 	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
     [java] 	at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
     [java] 	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
     [java] Caused by: java.lang.Exception: Table/View 'ATTACHMENTINFO' does not exist.
     [java] 	at org.apache.cayenne.remote.service.BaseRemoteService.processMessage(BaseRemoteService.java:160)
     [java] 	... 25 more

--- from server ---
INFO  org.apache.cayenne.remote.service.BaseRemoteService :156 - error processing message
     [java] java.sql.SQLSyntaxErrorException: Table/View 'ATTACHMENTINFO' does not exist.
     [java] 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
     [java] 	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
     [java] 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
     [java] 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
     [java] 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
     [java] 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
     [java] 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(Unknown Source)
     [java] 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(Unknown Source)
     [java] 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(Unknown Source)
     [java] 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement40.<init>(Unknown Source)
     [java] 	at org.apache.derby.jdbc.Driver40.newEmbedPreparedStatement(Unknown Source)
     [java] 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
     [java] 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
     [java] 	at org.apache.cayenne.conn.ConnectionWrapper.prepareStatement(ConnectionWrapper.java:281)
     [java] 	at org.apache.cayenne.conn.ConnectionWrapper.prepareStatement(ConnectionWrapper.java:287)
     [java] 	at org.apache.cayenne.access.TransactionConnectionDecorator.prepareStatement(TransactionConnectionDecorator.java:186)
     [java] 	at org.apache.cayenne.access.jdbc.SQLTemplateAction.execute(SQLTemplateAction.java:155)
     [java] 	at org.apache.cayenne.access.jdbc.SQLTemplateAction.performAction(SQLTemplateAction.java:134)
     [java] 	at org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:87)
     [java] 	at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:269)
     [java] 	at org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java:418)
     [java] 	at org.apache.cayenne.access.DataDomainQueryAction.access$000(DataDomainQueryAction.java:65)
     [java] 	at org.apache.cayenne.access.DataDomainQueryAction$2.transform(DataDomainQueryAction.java:391)
     [java] 	at org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:850)
     [java] 	at org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(DataDomainQueryAction.java:388)
     [java] 	at org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:117)
     [java] 	at org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:743)
     [java] 	at org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:333)
     [java] 	at org.apache.cayenne.util.ObjectContextQueryAction.execute(ObjectContextQueryAction.java:96)
     [java] 	at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:1278)
     [java] 	at org.apache.cayenne.access.ClientServerChannelQueryAction.runQuery(ClientServerChannelQueryAction.java:119)
     [java] 	at org.apache.cayenne.access.ClientServerChannelQueryAction.execute(ClientServerChannelQueryAction.java:65)
     [java] 	at org.apache.cayenne.access.ClientServerChannel.onQuery(ClientServerChannel.java:81)
     [java] 	at org.apache.cayenne.remote.service.DispatchHelper.dispatch(DispatchHelper.java:39)
     [java] 	at org.apache.cayenne.remote.service.BaseRemoteService.processMessage(BaseRemoteService.java:152)
     [java] 	at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
     [java] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [java] 	at java.lang.reflect.Method.invoke(Method.java:597)
     [java] 	at com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:180)
     [java] 	at com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:109)
     [java] 	at com.caucho.hessian.server.HessianServlet.service(HessianServlet.java:396)
     [java] 	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
     [java] 	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
     [java] 	at ish.oncourse.server.SecurityFilter.doFilter(SecurityFilter.java:111)
     [java] 	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
     [java] 	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
     [java] 	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
     [java] 	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
     [java] 	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
     [java] 	at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
     [java] 	at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
     [java] 	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
     [java] 	at org.mortbay.jetty.Server.handle(Server.java:326)
     [java] 	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
     [java] 	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
     [java] 	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:842)
     [java] 	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
     [java] 	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
     [java] 	at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
     [java] 	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
     [java] Caused by: java.sql.SQLException: Table/View 'ATTACHMENTINFO' does not exist.
     [java] 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
     [java] 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
     [java] 	... 60 more
     [java] Caused by: ERROR 42X05: Table/View 'ATTACHMENTINFO' does not exist.
     [java] 	at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
     [java] 	at org.apache.derby.impl.sql.compile.FromBaseTable.bindTableDescriptor(Unknown Source)

Re: EJBQL client-side challenge

Posted by Andrus Adamchik <an...@objectstyle.org>.
On Jan 26, 2010, at 5:37 PM, Lachlan Deck wrote:

> Does this affect sql templates as well from ROP?

Not this particular issue. So it depends on how SQLTemplate metadata  
handling is implemented (and IIRC it is implemented in an ROP-safe way).

Andrus

Re: EJBQL client-side challenge

Posted by Lachlan Deck <la...@gmail.com>.
On 27/01/2010, at 2:25 AM, Andrus Adamchik wrote:

> Actually looks like we can reproduce this problem. EJBQLQuery does query compilation on the client, and that accesses DbRelationships. So this is not related to naming, but rather to the use of joins.
> 
> A fix can be rather invasive, so how does everybody feel about making EJBQL a server-only feature in 3.0 and doing necessary refactoring in 3.1?

Does this affect sql templates as well from ROP?



> Andrus
> 
> On Jan 26, 2010, at 5:03 PM, Andrus Adamchik wrote:
> 
>> 
>> On Jan 26, 2010, at 4:50 PM, Lachlan Deck wrote:
>> 
>>> Strictly speaking, yes. But you could also say that one is a derivative of the other. e.g., upper-casing camel casing and joined via underscore which is a common db mapping (which perhaps cayenne allows for, especially when reverse engineering).
>> 
>> No, Cayenne doesn't make any such adhoc conversions. So MT_TABLE and MtTable1 are different names, and the framework will not attempt a conversion.
>> 
>> So do you have a stack trace of the error BTW?
>> 
>> Andrus
>> 
> 

with regards,
--

Lachlan Deck




Re: EJBQL client-side challenge

Posted by Andrus Adamchik <an...@objectstyle.org>.
Actually looks like we can reproduce this problem. EJBQLQuery does  
query compilation on the client, and that accesses DbRelationships. So  
this is not related to naming, but rather to the use of joins.

A fix can be rather invasive, so how does everybody feel about making  
EJBQL a server-only feature in 3.0 and doing necessary refactoring in  
3.1?

Andrus

On Jan 26, 2010, at 5:03 PM, Andrus Adamchik wrote:

>
> On Jan 26, 2010, at 4:50 PM, Lachlan Deck wrote:
>
>> Strictly speaking, yes. But you could also say that one is a  
>> derivative of the other. e.g., upper-casing camel casing and joined  
>> via underscore which is a common db mapping (which perhaps cayenne  
>> allows for, especially when reverse engineering).
>
> No, Cayenne doesn't make any such adhoc conversions. So MT_TABLE and  
> MtTable1 are different names, and the framework will not attempt a  
> conversion.
>
> So do you have a stack trace of the error BTW?
>
> Andrus
>


Re: EJBQL client-side challenge

Posted by Andrus Adamchik <an...@objectstyle.org>.
On Jan 26, 2010, at 4:50 PM, Lachlan Deck wrote:

> Strictly speaking, yes. But you could also say that one is a  
> derivative of the other. e.g., upper-casing camel casing and joined  
> via underscore which is a common db mapping (which perhaps cayenne  
> allows for, especially when reverse engineering).

No, Cayenne doesn't make any such adhoc conversions. So MT_TABLE and  
MtTable1 are different names, and the framework will not attempt a  
conversion.

So do you have a stack trace of the error BTW?

Andrus

Re: EJBQL client-side challenge

Posted by Lachlan Deck <la...@gmail.com>.
On 27/01/2010, at 12:52 AM, Khailenko Ksenia wrote:

> Does the scenario at
> org.apache.cayenne.CayenneContextEJBQLTest.testEJBQLSelect() satisfy to the
> conditions you are talking about?
> Because in such a case we have the DbEntity with name "MT_TABLE1" and the
> ObjEntity with name "MtTable1" - they are different, aren't they?

Strictly speaking, yes. But you could also say that one is a derivative of the other. e.g., upper-casing camel casing and joined via underscore which is a common db mapping (which perhaps cayenne allows for, especially when reverse engineering).

> This test
> successfully passes with query "SELECT a FROM MtTable1 a", and fails on
> query "SELECT COUNT(a) FROM MtTable1 a" but not for the reason that you
> have, but because there is a problem with the processing scalar results.
> Could you give a more concrete example if I misunderstood the problem?

DbEntity name -> Foo
ObjEntity name -> Bar.

No similarities.

> 2010/1/26 Lachlan Deck <la...@gmail.com>
> 
>> On 26/01/2010, at 6:51 PM, Andrus Adamchik wrote:
>> 
>>> Will need to investigate that. Could be a bug. IIRC we officially
>> supported EJBQL on the client.
>> 
>> Sure. Just to be clear, this error only occurs if the DbEntity name differs
>> from the ObjEntity name. Similar problems would occur (I imagine) with
>> property names.
>> 
>>> 
>>> Andrus
>>> 
>>> On Jan 26, 2010, at 2:10 AM, Lachlan Deck wrote:
>>> 
>>>> On 25/01/2010, at 6:19 PM, Andrus Adamchik wrote:
>>>> 
>>>>>> I realise that the original reasoning for this was security
>>>>> 
>>>>> This and also a general desire to encapsulate as many server details as
>> possible.
>>>>> 
>>>>>> this presents a challenge for utilising EJBQ
>>>>> 
>>>>> EJBQL should work without knowledge of DbEntity. What errors are you
>> getting? We may be able to fix by fixing processing pipeline.
>>>> 
>>>> If you use a simple query such as 'SELECT COUNT(a) FROM
>> SomeEntityName....' the error returned is that no such Table/View exists.
>>>> 
>>>> with regards,
>>>> --
>>>> 
>>>> Lachlan Deck
>>>> 
>>>> 
>>>> 
>>>> 
>>> 
>> 
>> with regards,
>> --
>> 
>> Lachlan Deck
>> 
>> 
>> 
>> 
> 
> 
> -- 
> Regards, Ksenia Khailenko

with regards,
--

Lachlan Deck




Re: EJBQL client-side challenge

Posted by Khailenko Ksenia <xe...@tut.by>.
Does the scenario at
org.apache.cayenne.CayenneContextEJBQLTest.testEJBQLSelect() satisfy to the
conditions you are talking about?
Because in such a case we have the DbEntity with name "MT_TABLE1" and the
ObjEntity with name "MtTable1" - they are different, aren't they? This test
successfully passes with query "SELECT a FROM MtTable1 a", and fails on
query "SELECT COUNT(a) FROM MtTable1 a" but not for the reason that you
have, but because there is a problem with the processing scalar results.
 Could you give a more concrete example if I misunderstood the problem?

2010/1/26 Lachlan Deck <la...@gmail.com>

> On 26/01/2010, at 6:51 PM, Andrus Adamchik wrote:
>
> > Will need to investigate that. Could be a bug. IIRC we officially
> supported EJBQL on the client.
>
> Sure. Just to be clear, this error only occurs if the DbEntity name differs
> from the ObjEntity name. Similar problems would occur (I imagine) with
> property names.
>
> >
> > Andrus
> >
> > On Jan 26, 2010, at 2:10 AM, Lachlan Deck wrote:
> >
> >> On 25/01/2010, at 6:19 PM, Andrus Adamchik wrote:
> >>
> >>>> I realise that the original reasoning for this was security
> >>>
> >>> This and also a general desire to encapsulate as many server details as
> possible.
> >>>
> >>>> this presents a challenge for utilising EJBQ
> >>>
> >>> EJBQL should work without knowledge of DbEntity. What errors are you
> getting? We may be able to fix by fixing processing pipeline.
> >>
> >> If you use a simple query such as 'SELECT COUNT(a) FROM
> SomeEntityName....' the error returned is that no such Table/View exists.
> >>
> >> with regards,
> >> --
> >>
> >> Lachlan Deck
> >>
> >>
> >>
> >>
> >
>
> with regards,
> --
>
> Lachlan Deck
>
>
>
>


-- 
Regards, Ksenia Khailenko

Re: EJBQL client-side challenge

Posted by Lachlan Deck <la...@gmail.com>.
On 26/01/2010, at 6:51 PM, Andrus Adamchik wrote:

> Will need to investigate that. Could be a bug. IIRC we officially supported EJBQL on the client.

Sure. Just to be clear, this error only occurs if the DbEntity name differs from the ObjEntity name. Similar problems would occur (I imagine) with property names.

> 
> Andrus
> 
> On Jan 26, 2010, at 2:10 AM, Lachlan Deck wrote:
> 
>> On 25/01/2010, at 6:19 PM, Andrus Adamchik wrote:
>> 
>>>> I realise that the original reasoning for this was security
>>> 
>>> This and also a general desire to encapsulate as many server details as possible.
>>> 
>>>> this presents a challenge for utilising EJBQ
>>> 
>>> EJBQL should work without knowledge of DbEntity. What errors are you getting? We may be able to fix by fixing processing pipeline.
>> 
>> If you use a simple query such as 'SELECT COUNT(a) FROM SomeEntityName....' the error returned is that no such Table/View exists.
>> 
>> with regards,
>> --
>> 
>> Lachlan Deck
>> 
>> 
>> 
>> 
> 

with regards,
--

Lachlan Deck




Re: EJBQL client-side challenge

Posted by Andrus Adamchik <an...@objectstyle.org>.
Will need to investigate that. Could be a bug. IIRC we officially  
supported EJBQL on the client.

Andrus

On Jan 26, 2010, at 2:10 AM, Lachlan Deck wrote:

> On 25/01/2010, at 6:19 PM, Andrus Adamchik wrote:
>
>>> I realise that the original reasoning for this was security
>>
>> This and also a general desire to encapsulate as many server  
>> details as possible.
>>
>>> this presents a challenge for utilising EJBQ
>>
>> EJBQL should work without knowledge of DbEntity. What errors are  
>> you getting? We may be able to fix by fixing processing pipeline.
>
> If you use a simple query such as 'SELECT COUNT(a) FROM  
> SomeEntityName....' the error returned is that no such Table/View  
> exists.
>
> with regards,
> --
>
> Lachlan Deck
>
>
>
>


Re: EJBQL client-side challenge

Posted by Lachlan Deck <la...@gmail.com>.
On 25/01/2010, at 6:19 PM, Andrus Adamchik wrote:

>> I realise that the original reasoning for this was security
> 
> This and also a general desire to encapsulate as many server details as possible.
> 
>> this presents a challenge for utilising EJBQ
> 
> EJBQL should work without knowledge of DbEntity. What errors are you getting? We may be able to fix by fixing processing pipeline.

If you use a simple query such as 'SELECT COUNT(a) FROM SomeEntityName....' the error returned is that no such Table/View exists.

with regards,
--

Lachlan Deck




Re: EJBQL client-side challenge

Posted by Andrus Adamchik <an...@objectstyle.org>.
>
> I realise that the original reasoning for this was security

This and also a general desire to encapsulate as many server details  
as possible.

> this presents a challenge for utilising EJBQ

EJBQL should work without knowledge of DbEntity. What errors are you  
getting? We may be able to fix by fixing processing pipeline.

Andrus


On Jan 25, 2010, at 12:51 AM, Lachlan Deck wrote:
> Hi there,
>
> ObjEntity.getDbEntityName() in ROP returns null as does DbEntity. I  
> realise that the original reasoning for this was security but this  
> presents a challenge for utilising EJBQL (or SQLTemplate for that  
> matter) to some extent from ROP.
>
> Two immediate problems:
> - if the ROP code only knows the name of the ObjEntity this won't  
> necessarily map to the same name in the DbEntity/ or table/view.
> - same again goes for attribute names.
> etc
>
> Is it worth rethinking this for 3.1?
>
> with regards,
> --
>
> Lachlan Deck
>
>