You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thanks torpedoquery is really awesome! However I am having a hard time sorting on multiple potentially empty columns
SELECT
COALESCE([individual].[last_name], [individual].[first_name], [enterprise].[registered_name], [enterprise].[trade_name]) AS [customer_name]
from customer
LEFT JOIN individual individual onindividual.id=customer.idLEFT JOIN enterprise enterprise ONenterprise.id=customer.idorder by COALESCE(individual.last_name, individual.first_name, enterprise.registered_name, enterprise.trade_name)
/* OR Simply */order by customer_name
In torpedo I am able to declare and use the following function in the select statement, but using it in the orderyBy causes a null pointer exception
Caused by: java.lang.NullPointerException
at org.torpedoquery.jpa.Torpedo$3.handle(Torpedo.java:702)
at org.torpedoquery.jpa.Torpedo$3.handle(Torpedo.java:698)
at org.torpedoquery.jpa.internal.handlers.AbstractCallHandler.handleValue(AbstractCallHandler.java:63)
at org.torpedoquery.jpa.internal.handlers.ArrayCallHandler.handleCall(ArrayCallHandler.java:46)
at org.torpedoquery.jpa.internal.handlers.ArrayCallHandler.handleCall(ArrayCallHandler.java:26)
at org.torpedoquery.jpa.internal.utils.TorpedoMethodHandler.handle(TorpedoMethodHandler.java:107)
at org.torpedoquery.jpa.Torpedo.orderBy(Torpedo.java:697)
at com.sti.uciscore.transaction.report.bean.ReportLoadServicesBean.createBillingConsumptionExceptionReportQuery(ReportLoadServicesBean.java:131)
at com.sti.uciscore.transaction.report.bean.ReportLoadServicesBean.generateReport(ReportLoadServicesBean.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82)
at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93)
at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:64)
at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:52)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:275)
... 76 more
Is there a way to achieve this? (for instance reproducing the SQL select (expression) as alias order by alias)
Thanks
The text was updated successfully, but these errors were encountered:
Hi Xavier,
First of all, thanks torpedoquery is really awesome! However I am having a hard time sorting on multiple potentially empty columns
In torpedo I am able to declare and use the following function in the select statement, but using it in the orderyBy causes a null pointer exception
Is there a way to achieve this? (for instance reproducing the SQL select (expression) as alias order by alias)
Thanks
The text was updated successfully, but these errors were encountered: