How to using alias in Active Object with Oracle DB?

Dang Thi Thuy Tien
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 22, 2020

I build the plugin and I have the query like this: 

Query query = Query.select()
.alias(WikiEntity.class, "wiki")
.alias(PanelEntity.class, "panel")
.join(PanelEntity.class, "wiki.PANEL_ID = panel.ID")
.order("panel.NAME").offset(offset).limit(limit) 

I run my plugin with H2, MySQL, Postgres is ok.

But cannot run it with Oracle.

I got this error:

Database:
- name:Oracle
- version:Oracle Database 18c Express Edition Release 18.0.0.0.0 - Production
- minor version:0
- major version:18
Driver:
- name:Oracle JDBC driver
- version:12.1.0.1.0
java.sql.SQLSyntaxErrorException: ORA-00904: "panel"."NAME": invalid identifier
at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.find(EntityManagedActiveObjects.java:152)
at com.atlassian.activeobjects.osgi.TenantAwareActiveObjects.find(TenantAwareActiveObjects.java:302)
... 2 filtered
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56)
at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:136)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70)
at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:136)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
at com.sun.proxy.$Proxy9278.find(Unknown Source)
at com.mgmtp.jira.addon.issuepanelsaddon.dao.repository.wikipanel.WikiPanelRepositoryImpl.getPanelByOffsetLimit(WikiPanelRepositoryImpl.java:214)
at com.mgmtp.jira.addon.issuepanelsaddon.service.wikipanel.WikiPanelServiceImpl.getPanelByPage(WikiPanelServiceImpl.java:224)
at com.mgmtp.jira.addon.issuepanelsaddon.action.admin.panelconfiguration.customizedpanel.ViewConfigurationPanelsAction.getWikiPanels(ViewConfigurationPanelsAction.java:93)
... 3 filtered

 

Anybody has the idea, how to make the plugin can run with all DB H2, MySQL, Postgres, and Oracle?

Many thanks,

1 answer

0 votes
Danylo Hovorun June 16, 2021

Hi @Dang Thi Thuy Tien 

Check this topic, it seems you have the same problem. Basically, the accepted answer is to make "panel"(which I assume to be an alias) uppercase in your query 
https://community.atlassian.com/t5/Jira-questions/Using-active-objects-alias-causes-error-ORA-00904-invalid/qaq-p/677687

Please let me know if it helped.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events