How to using alias in Active Object with Oracle DB?
Asked by Dang Thi Thuy Tien:

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,


Answers:
author: Danylo Hovorun
body: Hi [@Dang Thi Thuy Tien](/t5/user/viewprofilepage/user-id/1553744)   

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.


Tags: active-objects

confluence-server

jira-server

oracle

server