Hi Team,
I am trying to fetch id for an associated table in OQL and getting below error.
Same query i could execute in hsql and in postgress.
Could anyone please suggest what is wrong in this query?
Query:
final String oqlQuery1 = "SELECT * FROM CFT.OtherFees as OF,CFT.OtherFees/OtherFees_FeeSchedule as OF_FS,"
+"(SELECT (SELECT ID FROM CFT.FeeSchedule WHERE Status='_Final' and ID=FS_FA.feescheduleid and FS_FA.feeagreementid=FA.ID ORDER BY Version DESC LIMIT 1) "
+" as FSID FROM CFT.FeeAgreement as FA ,CFT.FeeSchedule/FeeSchedule_FeeAgreement as FS_FA WHERE Status='Active' and FS_FA.feeagreementid=FA.ID) as FeeSch "
+"WHERE OF.ID=OF_FS.otherfeesid and OF_FS.feescheduleid=FeeSch.FSID and FeeSch.FSID is not null";
String oqlQuery2 = String.format(new StringBuilder(oqlQuery1).toString());
Stacktrace:
Caused by: com.mendix.connectionbus.ConnectionBusRuntimeException: 'FeeSchedule_FeeAgreement' is not a valid entity type., exception occurred on mapping the following query: SELECT (SELECT ID FROM CFT.FeeSchedule WHERE Status = '_Final' AND ID = FS_FA.feescheduleid AND FS_FA.feeagreementid = FA.ID ORDER BY Version DESC LIMIT 1) AS FSID FROM CFT.FeeAgreement AS FA, CFT.FeeSchedule/FeeSchedule_FeeAgreement AS FS_FA WHERE FA.status = ? AND FS_FA.feeagreementid = FA.ID
at com.mendix.connectionbus.retrieve.query.mapping.QueryMapper.getMappedQueries(QueryMapper.java:259)
Caused by: com.mendix.connectionbus.ConnectionBusRuntimeException: 'FeeSchedule_FeeAgreement' is not a valid entity type.
at com.mendix.connectionbus.util.LegacyModel$$anonfun$getMetaObject$1.apply(LegacyModel.scala:43)
at com.mendix.connectionbus.util.LegacyModel$$anonfun$getMetaObject$1.apply(LegacyModel.scala:43)
at scala.Option.getOrElse(Option.scala:121)
at com.mendix.connectionbus.util.LegacyModel.getMetaObject(LegacyModel.scala:43)
at com.mendix.connectionbus.DomainModelUtilImpl.getPersistableMetaObject(DomainModelUtil.scala:70)
at com.mendix.connectionbus.DomainModelUtil$.getPersistableMetaObject(DomainModelUtil.scala:30)
at com.mendix.connectionbus.DomainModelUtil.getPersistableMetaObject(DomainModelUtil.scala)
at com.mendix.connectionbus.retrieve.query.mapping.MetaObjectInfo.getMetaObject(MetaObjectInfo.java:137)
at com.mendix.connectionbus.retrieve.query.mapping.QueryColumnItemHandler.createColumnDefinition(QueryColumnItemHandler.java:158)
at com.mendix.connectionbus.retrieve.query.mapping.QueryColumnItemHandler.mapSelectorLocation(QueryColumnItemHandler.java:127)
at com.mendix.connectionbus.retrieve.query.mapping.QueryColumnItemHandler.handleQueryWhereTermLocation(QueryColumnItemHandler.java:64)
at com.mendix.connectionbus.retrieve.query.mapping.WhereClauseMapper.prehandleWhereTermSide(WhereClauseMapper.java:227)
at com.mendix.connectionbus.retrieve.query.mapping.WhereClauseMapper.handleWhereTerm(WhereClauseMapper.java:159)
at com.mendix.connectionbus.retrieve.query.mapping.WhereClauseMapper.map(WhereClauseMapper.java:136)
at com.mendix.connectionbus.retrieve.query.mapping.QueryMapper.mapWhereClauseWhereTerms(QueryMapper.java:714)
at com.mendix.connectionbus.retrieve.query.mapping.QueryMapper.getMappedQueries(QueryMapper.java:227)
at com.mendix.connectionbus.retrieve.query.mapping.QueryMapper.getQueryInstances(QueryMapper.java:128)
at com.mendix.connectionbus.retrieve.query.mapping.QueryMapper.prepareQueryFromElements(QueryMapper.java:821)
at com.mendix.connectionbus.retrieve.query.mapping.QueryMapper.<init>(QueryMapper.java:106)
at com.mendix.connectionbus.retrieve.query.mapping.QueryMapper.getQueryInstances(QueryMapper.java:127)
at com.mendix.connectionbus.retrieve.DataStoreCaller.doOldQueryHandling(DataStoreCaller.java:101)
at com.mendix.connectionbus.retrieve.DataStoreCaller.mapToQueryInstances(DataStoreCaller.java:148)
at com.mendix.connectionbus.retrieve.DataStoreCaller.getResult(DataStoreCaller.java:77)
at com.mendix.connectionbus.retrieve.GetRequestHandler.doRequest(GetRequestHandler.java:62)
at com.mendix.connectionbus.RequestAnalyzer.doRequest(RequestAnalyzer.java:41)
at com.mendix.connectionbus.ConnectionBusImpl.doRequest(ConnectionBusImpl.java:459)
at com.mendix.core.action.user.RetrieveOQLDataTableAction.executeAction(RetrieveOQLDataTableAction.java:92)
at com.mendix.core.action.user.RetrieveOQLDataTableAction.executeAction(RetrieveOQLDataTableAction.java:17)
at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:49)
at com.mendix.core.actionmanagement.CoreAction.doCall(CoreAction.java:260)
at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:248)
at com.mendix.core.actionmanagement.ActionManager$1.execute(ActionManager.java:168)
at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:32)
at com.mendix.core.actionmanagement.ActionManager.executeSync(ActionManager.java:174)
at com.mendix.core.component.InternalCore.retrieveOQLDataTable(InternalCore.java:999)
at com.mendix.core.Core.retrieveOQLDataTable(Core.java:933)
at com.mendix.core.Core.retrieveOQLDataTable(Core.java:920)
at otherfees.actions.JA_RetrieveQuery.executeAction(JA_RetrieveQuery.java:63)
at otherfees.actions.JA_RetrieveQuery.executeAction(JA_RetrieveQuery.java:29)
at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:49)
at com.mendix.core.actionmanagement.CoreAction.doCall(CoreAction.java:260)
at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:248)
at com.mendix.core.actionmanagement.ActionManager$1.execute(ActionManager.java:168)
at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:32)
at com.mendix.core.actionmanagement.ActionManager.executeSync(ActionManager.java:174)
at com.mendix.core.component.InternalCore.execute(InternalCore.java:383)
at com.mendix.modules.microflowengine.actions.actioncall.JavaAction.execute(JavaAction.scala:52)
at com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.execute(MicroflowObject.java:47)
at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAfterBreakingIfNecessary(MicroflowImpl.java:192)
at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAction(MicroflowImpl.java:149)
at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:49)
at com.mendix.core.actionmanagement.CoreAction.doCall(CoreAction.java:260)
at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:248)
at com.mendix.core.actionmanagement.ActionManager$1.execute(ActionManager.java:168)
at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:32)
at com.mendix.core.actionmanagement.ActionManager.executeSync(ActionManager.java:174)
at com.mendix.core.component.InternalCore.execute(InternalCore.java:383)
at com.mendix.webui.actions.client.ExecuteAction.execute(ExecuteAction.java:135)
at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply$mcV$sp(ClientRequestHandler.scala:317)
at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply(ClientRequestHandler.scala:312)
at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply(ClientRequestHandler.scala:312)
at com.mendix.core.session.Worker$$anonfun$receive$3$$anonfun$2$$anon$1.execute(ActionDispatching.scala:144)
at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:32)
at com.mendix.core.session.Worker$$anonfun$receive$3$$anonfun$2.apply(ActionDispatching.scala:146)
at scala.util.Try$.apply(Try.scala:192)
at com.mendix.core.session.Worker$$anonfun$receive$3.applyOrElse(ActionDispatching.scala:140)
at akka.actor.Actor$class.aroundReceive(Actor.scala:465)
at com.mendix.core.session.Worker.aroundReceive(ActionDispatching.scala:136)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)
at akka.actor.ActorCell.invoke(ActorCell.scala:487)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238)
at akka.dispatch.Mailbox.run(Mailbox.scala:220)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)