Joined: Fri Apr 13, 2007 10:58 am Posts: 10
|
Hello,
I am using JBoss as Application Server(version 4.0.2) , Spring(version 1.2.8) and Hibernate(version 3.0) in my web application. I want to populate an object using the results i get by executing my native sql query.But i am getting an Invalid identifier error
The details as required by the forum are as follows :
Hibernate version: 3.0
Mapping documents:
Note : The object mapped in this mapping is not a persistent entity, its just used in the application.And this object (OverallPerformanceMetric.java) is populated using the results fetched by my native SQL query as mentioned later in this post.
Code: <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping> <class name="com.performixtech.emvolve.businesstransformations.api.OverallPerformanceMetric" lazy="true"> <id name= "id" type="long" column="metric_uid"> <generator class="native"/> </id> <property name="objectiveName" type="string" column="objective_name"/> <property name="targetPeriodTypeID" type="long" column="target_period_type_uid"/> <property name="objectiveID" type="long" column="objective_uid"/> <property name="objectiveCode" type="string" column="objective_code"/> <property name="objectiveClass" type="string" column="class_name"/> <property name="objectiveAdditionalInfo" type="string" column="obj_additional_info"/> <property name="employeeName" type="string" column="employee_name"/> <property name="employeeID" type="long" column="employee_uid"/> <property name="groupManager" type="string" column="manager_name"/> <property name="managerID" type="long" column="manager_uid"/> <property name="groupID" type="long" column="group_uid"/> <property name="groupName" type="string" column="group_name"/> <property name="experienceLevelID" type="long" column="experience_level_uid"/> <property name="showThresholdMatrix" type="boolean" column="obj_show_threshold_mtrx"/> <property name="showArrowFlag" type="boolean" column="show_arrow_flag"/> <property name="periodStartDate" type="java.util.Date" column="period_start_datetime"/> <property name="periodEndDate" type="java.util.Date" column="period_end_datetime"/> <component name="trend" class="com.performixtech.emvolve.businesstransformations.model.ResultTrendType"> <property name="name" type="string" column="trend_type"/> <property name="type" type="integer" column="trend_type_value"/> </component> <component name="individualRating" class="com.performixtech.emvolve.businesstransformations.api.Rating"> <property name="rating" type="float" column="rating"/> <property name="ratingUnit" type="string" column="rating_unit"/> <property name="ratingSelectionName" type="string" column="rating_name"/> <property name="ratingSelection" type="integer" column="rating_defn_uid"/> <component name="ratingIcon" class="com.performixtech.emvolve.configurations.model.RatingIcon"> <property name="icon" type="string" column="icon"/> <property name="contentType" type="string" column="icon_content_type"/> <property name="iconName" type="string" column="icon_name"/> <property name="url" type="string" column="icon_url"/> <property name="colorCode" type="long" column="icon_color"/> </component> </component> <property name="result" type="float" column="result"/> <property name="resultUnit" type="string" column="result_unit"/> <property name="overriden" type="boolean" column="is_overridden"/> <property name="overrideable" type="boolean" column="metric_overrideable"/> <property name="manualResult" type="boolean" column="is_manual_result"/> <property name="manualRating" type="boolean" column="is_manual_rating"/> <property name="showUnderlyingData" type="boolean" column="show_data_elements_flag"/> <property name="showSupportingData" type="boolean" column="show_supporting_data_flag"/> <property name="showRating" type="boolean" column="rating_disp_flag"/> <property name="showResult" type="boolean" column="result_disp_flag"/> <component name="overridenRating" class="com.performixtech.emvolve.businesstransformations.api.Rating"> <property name="rating" type="float" column="ovrd_rating"/> <property name="ratingUnit" type="string" column="ovrd_rating_unit"/> <property name="ratingSelectionName" type="string" column="ovrd_rating_name"/> <property name="ratingSelection" type="integer" column="ovrd_rating_defn_uid"/> <component name="ratingIcon" class="com.performixtech.emvolve.configurations.model.RatingIcon"> <property name="icon" type="string" column="ovrd_icon"/> <property name="contentType" type="string" column="ovrd_icon_content_type"/> <property name="iconName" type="string" column="ovrd_icon_name"/> <property name="url" type="string" column="ovrd_icon_url"/> <property name="colorCode" type="long" column="ovrd_icon_color"/> </component> </component> <component name="overallPerformanceRating" class="com.performixtech.emvolve.businesstransformations.api.Rating"> <property name="rating" type="float" column="oar_rating"/> <property name="ratingUnit" type="string" column="oar_rating_unit"/> <property name="ratingSelectionName" type="string" column="oar_rating_name"/> <property name="ratingSelection" type="integer" column="oar_rating_defn_uid"/> <component name="ratingIcon" class="com.performixtech.emvolve.configurations.model.RatingIcon"> <property name="icon" type="string" column="oar_icon"/> <property name="contentType" type="string" column="oar_icon_content_type"/> <property name="iconName" type="string" column="oar_icon_name"/> <property name="url" type="string" column="oar_icon_url"/> <property name="colorCode" type="long" column="oar_icon_color"/> </component> </component> <component name="overallPerformanceRatingGroup" class="com.performixtech.emvolve.businesstransformations.api.Rating"> <property name="rating" type="float" column="oarg_rating"/> <property name="ratingUnit" type="string" column="oarg_rating_unit"/> <property name="ratingSelectionName" type="string" column="oarg_rating_name"/> <property name="ratingSelection" type="integer" column="oarg_rating_defn_uid"/> <component name="ratingIcon" class="com.performixtech.emvolve.configurations.model.RatingIcon"> <property name="icon" type="string" column="oarg_icon"/> <property name="contentType" type="string" column="oarg_icon_content_type"/> <property name="iconName" type="string" column="oarg_icon_name"/> <property name="url" type="string" column="oarg_icon_url"/> <property name="colorCode" type="long" column="oarg_icon_color"/> </component> </component> <property name="overridenResult" type="float" column="override_result"/> <property name="teamResult" type="float" column="team_result"/> <property name="target" type="float" column="target"/> <property name="targetUnit" type="string" column="target_unit"/> <property name="groupObjectiveRank" type="integer" column="objective_rank"/> <property name="groupObjectiveClassRank" type="integer" column="class_rank"/> <property name="objectiveWeighting" type="float" column="objective_weight"/> <property name="groupWeighting" type="float" column="group_weight"/> <property name="displayMask" type="string" column="display_mask"/> <property name="perfMetricTypeValue" type="integer" column="metric_type_value"/> <property name="perfMetricTypeName" type="string" column="metric_type_name"/> <property name="employeeTypeValue" type="integer" column="employee_type_value"/> <property name="employeeType" type="string" column="employee_type"/> <filter name="periodFilter" condition=":myPeriod BETWEEN manager_group_start_datetime and manager_group_end_datetime"/> <filter name="ManID" condition=":manID = employee_uid"/> </class> </hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
Code: Session hibernateSession = this.getSession();
if (hibernateSession != null) { managersData = hibernateSession.createSQLQuery( ScorecardDataQueries. modifiedQuery(false)) .addEntity(ENTITY_NAME_MAN, OverallPerformanceMetric.class). setLong(ScorecardDataQueries.EMP_ID_PARAM_NAME, employeeId) .setLong(ScorecardDataQueries.MM_PERIOD_TYPE_ID_PARAM_NAME, mmpTypeId).setDate(ScorecardDataQueries.DATE_PARAM_NAME, maxDate).list(); hibernateSession.flush(); hibernateSession.clear(); } Full stack trace of any exception that occurs:
Code: org.hibernate.exception.SQLGrammarException: could not execute query at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter .java:70) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelp er.java:43) at org.hibernate.loader.Loader.doList(Loader.java:1565) at org.hibernate.loader.Loader.list(Loader.java:1545) at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:103) at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1406)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:151) at com.performixtech.emvolve.businesstransformations.dao.PerformanceMana gerDAOImpl.getManagerOverallPerformanceMetrics(PerformanceManagerDAOImpl.java:28 7) at com.performixtech.emvolve.businesstransformations.controllers.Perform anceManagerImpl.getManagerOverallPerformanceMetrics(PerformanceManagerImpl.java: 122) at com.performixtech.emvolve.businesstransformations.ejb.PerformanceMana gerBean.getManagerOverallPerformanceMetrics(PerformanceManagerBean.java:83) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.jboss.invocation.Invocation.performCall(Invocation.java:345) at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(S tatelessSessionContainer.java:214) at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invo ke(CachedConnectionInterceptor.java:185) at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(Stat elessSessionInstanceInterceptor.java:130) at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(Service EndpointInterceptor.java:51) at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidation Interceptor.java:48) at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte rceptor.java:105) at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep torCMT.java:335) at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:1 66) at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor. java:139) at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192) at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFacto ryFinderInterceptor.java:122) at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:6 24) at org.jboss.ejb.Container.invoke(Container.java:873) at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalPro xyFactory.java:413) at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSes sionProxy.java:88) at $Proxy139.getManagerOverallPerformanceMetrics(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.springframework.ejb.access.LocalSlsbInvokerInterceptor.invoke(Loc alSlsbInvokerInterceptor.java:66) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed( ReflectiveMethodInvocation.java:170) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynami cAopProxy.java:176) at $Proxy429.getManagerOverallPerformanceMetrics(Unknown Source) at com.performixtech.emvolve.performancereview.delegate.PerformanceManag er.getManagerOverallPerformanceMetrics(PerformanceManager.java:141) at com.performixtech.emvolve.web.containers.OverAllPerformanceContainer. produceList(OverAllPerformanceContainer.java:203) at com.performixtech.emvolve.web.containers.OverAllPerformanceContainer. callAPI(OverAllPerformanceContainer.java:144) at com.performixtech.emvolve.web.xmlgenerator.OverAllPerformanceXMLGener ator.produceXML(OverAllPerformanceXMLGenerator.java:99) at com.performixtech.emvolve.performancereview.ui.common.actions.Overall PerformanceOLController.handle(OverallPerformanceOLController.java:274) at org.springframework.web.servlet.mvc.AbstractCommandController.handleR equestInternal(AbstractCommandController.java:81) at org.springframework.web.servlet.mvc.AbstractController.handleRequest( AbstractController.java:153) at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.ha ndle(SimpleControllerHandlerAdapter.java:44) at org.springframework.web.servlet.DispatcherServlet.doDispatch(Dispatch erServlet.java:723) at org.springframework.web.servlet.DispatcherServlet.doService(Dispatche rServlet.java:663) at org.springframework.web.servlet.FrameworkServlet.processRequest(Frame workServlet.java:394) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServ let.java:358) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:173) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi lter.java:81) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV alve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV alve.java:178) at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrinc ipalValve.java:39) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit yAssociationValve.java:153) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv e.java:59) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j ava:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j ava:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal ve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav a:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java :856) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce ssConnection(Http11Protocol.java:744) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo int.java:527) at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWor kerThread.java:112) at java.lang.Thread.run(Thread.java:534) Caused by: java.sql.SQLException: ORA-00904: "MAN"."EMPLOYEE_TYPE_VALUE": invali d identifier
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java :125) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:305) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272) at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:623) at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement. java:181) at oracle.jdbc.driver.T4CPreparedStatement.execute_for_describe(T4CPrepa redStatement.java:420) at oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleState ment.java:896) at oracle.jdbc.driver.T4CPreparedStatement.execute_maybe_describe(T4CPre paredStatement.java:452) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme nt.java:986) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePrep aredStatement.java:2888) at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePrepare dStatement.java:2929) at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery (WrappedPreparedStatement.java:296) at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java: 118) at org.hibernate.loader.Loader.getResultSet(Loader.java:1239) at org.hibernate.loader.Loader.doQuery(Loader.java:374) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Lo ader.java:210) at org.hibernate.loader.Loader.doList(Loader.java:1562) ... 69 more 20:31:09,281 ERROR [com.performixtech.emvolve.web.xmlgenerator.OverAllPerformanc eXMLGenerator] No resource is associated with key "RuntimeException; CausedByExc eption is: could not execute query". 20:31:09,281 ERROR [com.performixtech.emvolve.web.xmlgenerator.OverAllPerformanc eXMLGenerator] RuntimeException; CausedByException is: could not execute query
Oracle 10gThe generated SQL (show_sql=true):
Code: SELECT man.metric_uid AS metric1_0_ ,man.objective_name AS objective2_245_0_ ,man.target_period_type_uid AS target3_245_0_ ,man.objective_uid AS objective4_245_0_ ,man.objective_code AS objective5_245_0_ ,man.class_name AS class6_245_0_ ,man.obj_additional_info AS obj7_245_0_ ,man.employee_name AS employee8_245_0_ ,man.employee_uid AS employee9_245_0_ ,man.manager_name AS manager10_245_0_ ,man.manager_uid AS manager11_245_0_ ,man.group_uid AS group12_245_0_ ,man.group_name AS group13_245_0_ ,man.experience_level_uid AS experience14_245_0_ ,man.obj_show_threshold_mtrx AS obj15_245_0_ ,man.show_arrow_flag AS show16_245_0_ ,man.period_start_datetime AS period17_245_0_ ,man.period_end_datetime AS period18_245_0_ ,man.trend_type AS trend19_245_0_ ,man.trend_type_value AS trend20_245_0_ ,man.rating AS rating245_0_ ,man.rating_unit AS rating22_245_0_ ,man.rating_name AS rating23_245_0_ ,man.rating_defn_uid AS rating24_245_0_ ,man.icon AS icon245_0_ ,man.icon_content_type AS icon26_245_0_ ,man.icon_name AS icon27_245_0_ ,man.icon_url AS icon28_245_0_ ,man.icon_color AS icon29_245_0_ ,man.result AS result245_0_ ,man.result_unit AS result31_245_0_ ,man.is_overridden AS is32_245_0_ ,man.metric_overrideable AS metric33_245_0_ ,man.is_manual_result AS is34_245_0_ ,man.is_manual_rating AS is35_245_0_ ,man.show_data_elements_flag AS show36_245_0_ ,man.show_supporting_data_flag AS show37_245_0_ ,man.rating_disp_flag AS rating38_245_0_ ,man.result_disp_flag AS result39_245_0_ ,man.ovrd_rating AS ovrd40_245_0_ ,man.ovrd_rating_unit AS ovrd41_245_0_ ,man.ovrd_rating_name AS ovrd42_245_0_ ,man.ovrd_rating_defn_uid AS ovrd43_245_0_ ,man.ovrd_icon AS ovrd44_245_0_ ,man.ovrd_icon_content_type AS ovrd45_245_0_ ,man.ovrd_icon_name AS ovrd46_245_0_ ,man.ovrd_icon_url AS ovrd47_245_0_ ,man.ovrd_icon_color AS ovrd48_245_0_ ,man.oar_rating AS oar49_245_0_ ,man.oar_rating_unit AS oar50_245_0_ ,man.oar_rating_name AS oar51_245_0_ ,man.oar_rating_defn_uid AS oar52_245_0_ ,man.oar_icon AS oar53_245_0_ ,man.oar_icon_content_type AS oar54_245_0_ ,man.oar_icon_name AS oar55_245_0_ ,man.oar_icon_url AS oar56_245_0_ ,man.oar_icon_color AS oar57_245_0_ ,man.oarg_rating AS oarg58_245_0_ ,man.oarg_rating_unit AS oarg59_245_0_ ,man.oarg_rating_name AS oarg60_245_0_ ,man.oarg_rating_defn_uid AS oarg61_245_0_ ,man.oarg_icon AS oarg62_245_0_ ,man.oarg_icon_content_type AS oarg63_245_0_ ,man.oarg_icon_name AS oarg64_245_0_ ,man.oarg_icon_url AS oarg65_245_0_ ,man.oarg_icon_color AS oarg66_245_0_ ,man.override_result AS override67_245_0_ ,man.team_result AS team68_245_0_ ,man.target AS target245_0_ ,man.target_unit AS target70_245_0_ ,man.objective_rank AS objective71_245_0_ ,man.class_rank AS class72_245_0_ ,man.objective_weight AS objective73_245_0_ ,man.group_weight AS group74_245_0_ ,man.display_mask AS display75_245_0_ ,man.metric_type_value AS metric76_245_0_ ,man.metric_type_name AS metric77_245_0_ ,man.employee_type_value AS employee78_245_0_ FROM ( ( SELECT DISTINCT rownum AS id ,1 AS metric_uid ,e.employee_uid AS employee_uid ,( e.first_name || ' ' || e.last_name ) AS employee_name ,e.employee_type_value AS employee_type_value ,el.experience_level_uid AS experience_level_uid ,eg.emp_group_uid AS group_uid ,g.name AS group_name ,m.employee_uid AS manager_uid ,o.objective_uid AS objective_uid ,o.name AS objective_name ,o.code AS objective_code ,o.target_period_type_uid AS target_period_type_uid ,o.display_mask AS display_mask ,fn_obj_rank_from_max_enddate( egcr.class_id ,egcr.objective_uid ,egcr.employee_uid ,mp.period_start_datetime ,mp.period_end_datetime ) AS objective_rank ,CASE WHEN o.show_additional_info = 1 THEN o.additional_info ELSE NULL END AS obj_additional_info ,o.show_threshold_mtrx AS obj_show_threshold_mtrx ,o.show_arrow_flag AS show_arrow_flag ,o.show_data_elements_flag AS show_data_elements_flag ,o.show_supporting_data_flag AS show_supporting_data_flag ,oc.name AS class_name ,fn_class_rank_from_max_enddate( egcr.class_id ,egcr.employee_uid ,mp.period_start_datetime ,mp.period_end_datetime ) AS class_rank ,NULL AS metric_type_value ,NULL AS metric_type_name ,mp.period_start_datetime AS period_start_datetime ,mp.period_end_datetime AS period_end_datetime ,fn_time_wgted_grp_wgt( eg.emp_group_uid ,mp.period_START_DATETIME ,mp.period_END_DATETIME ) AS group_weight ,fn_time_wgted_obj_wgt( o.OBJECTIVE_UID ,eg.employee_uid ,eg.emp_group_uid ,mp.period_start_datetime ,mp.period_end_datetime ) AS objective_weight ,NULL AS result ,NULL AS override_result ,NULL AS team_result ,NULL AS result_unit ,NULL AS rating_defn_uid ,NULL AS rating_name ,NULL AS icon ,NULL AS rating ,NULL AS rating_unit ,NULL AS icon_content_type ,NULL AS icon_name ,NULL AS icon_url ,NULL AS icon_color ,NULL AS ovrd_rating_defn_uid ,NULL AS ovrd_rating_name ,NULL AS ovrd_icon ,NULL AS ovrd_rating ,NULL AS ovrd_rating_unit ,NULL AS ovrd_icon_content_type ,NULL AS ovrd_icon_name ,NULL AS ovrd_icon_url ,NULL AS ovrd_icon_color ,NULL AS oarg_rating_defn_uid ,NULL AS oarg_rating_name ,NULL AS oarg_icon ,NULL AS oarg_rating ,NULL AS oarg_rating_unit ,NULL AS oarg_icon_content_type ,NULL AS oarg_icon_name ,NULL AS oarg_icon_url ,NULL AS oarg_icon_color ,NULL AS oar_rating_defn_uid ,NULL AS oar_rating_name ,NULL AS oar_icon ,NULL AS oar_rating ,NULL AS oar_rating_unit ,NULL AS oar_icon_content_type ,NULL AS oar_icon_name ,NULL AS oar_icon_url ,NULL AS oar_icon_color ,NULL AS is_overridden ,fn_get_rbt_manual_flag( o.objective_uid ,mpt.metric_meas_period_type_uid ,mp.period_end_datetime ) AS metric_overrideable ,CASE WHEN o.objective_type = 2 THEN 1 ELSE 0 END AS is_manual_result ,CASE WHEN o.objective_type = 3 THEN 1 ELSE 0 END AS is_manual_rating ,ot.target_value AS target ,ot.target_unit AS target_unit ,NULL AS trend_type ,NULL AS trend_type_value ,fn_radisp_from_max_enddate( o.objective_uid ,mp.period_start_datetime ,mp.period_end_datetime ,mp.metric_meas_period_type_uid ) AS rating_disp_flag ,fn_redisp_from_max_enddate( o.objective_uid ,mp.period_start_datetime ,mp.period_end_datetime ,mp.metric_meas_period_type_uid ) AS result_disp_flag FROM employee e INNER JOIN employee_group eg ON( eg.employee_uid = e.employee_uid AND e.employee_uid = ? AND eg.end_datetime > eg.start_datetime ) INNER JOIN metric_measure_period mp ON( eg.start_datetime < mp.period_end_datetime AND eg.start_datetime < mp.period_end_datetime AND mp.period_start_datetime < eg.end_datetime AND mp.period_end_datetime >= least( eg.end_datetime ,mp.period_end_datetime ) AND mp.period_start_datetime <= ? AND ? < mp.period_end_datetime ) INNER JOIN metric_meas_period_type mpt ON( mpt.metric_meas_period_type_uid = mp.metric_meas_period_type_uid AND mpt.metric_meas_period_type_uid = ? ) INNER JOIN emp_group g ON( eg.emp_group_uid = g.emp_group_uid ) INNER JOIN objective_employee_group oeg ON( eg.employee_group_id = oeg.employee_group_id AND oeg.start_datetime < mp.period_end_datetime AND mp.period_start_datetime < oeg.end_datetime AND mp.period_end_datetime >= least( oeg.end_datetime ,mp.period_end_datetime ) ) INNER JOIN objective o ON( o.objective_uid = oeg.objective_uid AND o.objective_type <> 4 ) LEFT OUTER JOIN objective_class oc ON( o.class_id = oc.class_id ) LEFT OUTER JOIN employee_group_class_rank egcr ON( egcr.objective_uid = o.objective_uid AND egcr.class_id = o.class_id AND egcr.employee_uid = eg.employee_uid AND egcr.emp_group_uid = g.emp_group_uid AND egcr.start_datetime < mp.period_end_datetime AND mp.period_start_datetime < egcr.end_datetime AND mp.period_end_datetime >= least( egcr.end_datetime ,mp.period_end_datetime ) AND egcr.end_datetime <> egcr.start_datetime ) LEFT OUTER JOIN experience_level el ON( el.experience_level_uid = fn_experience_from_max_enddate( o.OBJECTIVE_UID ,eg.employee_group_id ,mp.period_start_datetime ,mp.period_end_datetime ) ) LEFT OUTER JOIN objective_target ot ON( o.objective_uid = ot.objective_uid AND el.experience_level_uid = ot.experience_level_uid AND ot.start_datetime < mp.period_end_datetime AND mp.period_end_datetime <= ot.end_datetime ) LEFT OUTER JOIN manager_group mg ON( mg.emp_group_uid = g.emp_group_uid AND mg.manager_group_id = fn_managerGrp_from_max_enddate( e.employee_uid ,eg.emp_group_uid ,mp.period_start_datetime ,mp.period_end_datetime ) AND mg.end_datetime > mg.start_datetime AND mg.start_datetime < mp.period_end_datetime AND mp.period_start_datetime < mg.end_datetime AND mp.period_end_datetime >= least( mg.end_datetime ,mp.period_end_datetime ) ) LEFT OUTER JOIN employee m ON( mg.manager_uid = m.employee_uid ) LEFT OUTER JOIN OBJECTIVE_RATING_DISP_PERIOD oradp ON( o.objective_uid = oradp.objective_uid AND mpt.metric_meas_period_type_uid = oradp.metric_meas_period_type_uid AND mpt.metric_meas_period_type_uid = ? AND oradp.start_datetime < mp.period_end_datetime AND mp.period_end_datetime >= least( oradp.end_datetime ,mp.period_end_datetime ) AND oradp.start_datetime < oradp.end_datetime ) LEFT OUTER JOIN OBJECTIVE_RESULT_DISP_PERIOD oredp ON( o.objective_uid = oredp.objective_uid AND mpt.metric_meas_period_type_uid = oredp.metric_meas_period_type_uid AND mpt.metric_meas_period_type_uid = ? AND oredp.start_datetime < mp.period_end_datetime AND mp.period_end_datetime >= least( oredp.end_datetime ,mp.period_end_datetime ) AND oredp.start_datetime < oredp.end_datetime ) WHERE o.objective_qualifier = 1 AND oeg.obj_emp_grp_qualifier = 1 AND NOT EXISTS( SELECT metric_uid FROM performance_metric f WHERE f.employee_uid = e.employee_uid AND e.employee_uid = ? AND f.emp_group_uid = g.emp_group_uid AND f.objective_uid = o.objective_uid AND f.metric_meas_period_type_uid = mpt.metric_meas_period_type_uid AND mpt.metric_meas_period_type_uid = ? AND mp.period_start_datetime <= f.metric_start_datetime AND f.metric_start_datetime < mp.period_end_datetime ) GROUP BY e.employee_uid ,e.first_name ,e.last_name ,e.employee_type ,e.employee_type_value ,el.experience_level_uid ,el.name ,el.level_value ,eg.emp_group_uid ,g.name ,m.employee_uid ,m.first_name ,m.last_name ,mg.manager_uid ,o.objective_uid ,o.name ,o.code ,o.target_period_type_uid ,o.display_mask ,o.additional_info ,o.show_threshold_mtrx ,o.show_arrow_flag ,oc.name ,mpt.metric_meas_period_type_uid ,mp.metric_meas_period_type_uid ,mpt.name ,mp.period_end_datetime ,ot.target_value ,ot.target_unit ,mp.period_start_datetime ,mp.period_end_datetime ,egcr.class_id ,egcr.objective_uid ,egcr.employee_uid ,o.show_additional_info ,o.show_data_elements_flag ,o.show_supporting_data_flag ,eg.employee_uid ,o.objective_type ,rownum ) UNION ( SELECT DISTINCT rownum AS id ,1 AS metric_uid ,e.employee_uid AS employee_uid ,( e.first_name || ' ' || e.last_name ) AS employee_name ,e.employee_type_value AS employee_type_value ,el.experience_level_uid AS experience_level_uid ,eg.emp_group_uid AS group_uid ,eg.name AS group_name ,m.employee_uid AS manager_uid ,o.objective_uid AS objective_uid ,o.name AS objective_name ,o.code AS objective_code ,o.target_period_type_uid AS target_period_type_uid ,o.display_mask AS display_mask ,fn_obj_rank_from_max_enddate( oc.class_id ,f.objective_uid ,f.employee_uid ,mp.period_start_datetime ,mp.period_end_datetime ) AS objective_rank ,CASE WHEN o.show_additional_info = 1 THEN o.additional_info ELSE NULL END AS obj_additional_info ,o.show_threshold_mtrx AS obj_show_threshold_mtrx ,o.show_arrow_flag AS show_arrow_flag ,o.show_data_elements_flag AS show_data_elements_flag ,o.show_supporting_data_flag AS show_supporting_data_flag ,oc.name AS class_name ,fn_class_rank_from_max_enddate( oc.class_id ,f.employee_uid ,mp.period_start_datetime ,mp.period_end_datetime ) AS class_rank ,pt.metric_type AS metric_type_value ,pt.metric_name AS metric_type_name ,mp.period_start_datetime AS period_start_datetime ,mp.period_end_datetime AS period_end_datetime ,fn_time_wgted_grp_wgt( eg.emp_group_uid ,mp.period_START_DATETIME ,mp.period_END_DATETIME ) AS group_weight ,fn_time_wgted_obj_wgt( o.OBJECTIVE_UID ,e_g.employee_uid ,e_g.emp_group_uid ,mp.period_START_DATETIME ,mp.period_END_DATETIME ) AS objective_weight ,f.result AS result ,f.override_result AS override_result ,f.team_result AS team_result ,f.result_unit AS result_unit ,CASE WHEN pt.metric_type IN ( 1 ,4 ) THEN rd.rating_defn_uid ELSE NULL END AS rating_defn_uid ,CASE WHEN pt.metric_type IN ( 1 ,4 ) THEN rd.name ELSE NULL END AS rating_name ,NULL AS icon ,CASE WHEN pt.metric_type IN ( 1 ,4 ) THEN rd.rating_value ELSE NULL END AS rating ,CASE WHEN pt.metric_type IN ( 1 ,4 ) THEN rd.rating_unit ELSE NULL END AS rating_unit ,CASE WHEN pt.metric_type IN ( 1 ,4 ) THEN rd.icon_content_type ELSE NULL END AS icon_content_type ,CASE WHEN pt.metric_type IN ( 1 ,4 ) THEN rd.icon_name ELSE NULL END AS icon_name ,CASE WHEN pt.metric_type IN ( 1 ,4 ) THEN rd.icon_url ELSE NULL END AS icon_url ,CASE WHEN pt.metric_type IN ( 1 ,4 ) THEN rd.icon_color ELSE NULL END AS icon_color ,rdo.rating_defn_uid AS ovrd_rating_defn_uid ,rdo.name AS ovrd_rating_name ,NULL AS ovrd_icon ,rdo.rating_value AS ovrd_rating ,rdo.rating_unit AS ovrd_rating_unit ,rdo.icon_content_type AS ovrd_icon_content_type ,rdo.icon_name AS ovrd_icon_name ,rdo.icon_url AS ovrd_icon_url ,rdo.icon_color AS ovrd_icon_color ,CASE WHEN pt.metric_type = 2 THEN ( CASE WHEN rdo.rating_defn_uid IS NOT NULL THEN rdo.rating_defn_uid ELSE rd.rating_defn_uid END ) ELSE NULL END AS oarg_rating_defn_uid ,CASE WHEN pt.metric_type = 2 THEN ( CASE WHEN rdo.rating_defn_uid IS NOT NULL THEN rdo.name ELSE rd.name END ) ELSE NULL END AS oarg_rating_name ,NULL AS oarg_icon ,CASE WHEN pt.metric_type = 2 THEN ( CASE WHEN rdo.rating_defn_uid IS NOT NULL THEN rdo.rating_value ELSE rd.rating_value END ) ELSE NULL END AS oarg_rating ,CASE WHEN pt.metric_type = 2 THEN ( CASE WHEN rdo.rating_defn_uid IS NOT NULL THEN rdo.rating_unit ELSE rd.rating_unit END ) ELSE NULL END AS oarg_rating_unit ,CASE WHEN pt.metric_type = 2 THEN ( CASE WHEN rdo.rating_defn_uid IS NOT NULL THEN rdo.icon_content_type ELSE rd.icon_content_type END ) ELSE NULL END AS oarg_icon_content_type ,CASE WHEN pt.metric_type = 2 THEN ( CASE WHEN rdo.rating_defn_uid IS NOT NULL THEN rdo.icon_name ELSE rd.icon_name END ) ELSE NULL END AS oarg_icon_name ,CASE WHEN pt.metric_type = 2 THEN ( CASE WHEN rdo.rating_defn_uid IS NOT NULL THEN rdo.icon_url ELSE rd.icon_url END ) ELSE NULL END AS oarg_icon_url ,CASE WHEN pt.metric_type = 2 THEN ( CASE WHEN rdo.rating_defn_uid IS NOT NULL THEN rdo.icon_color ELSE rd.icon_color END ) ELSE NULL END AS oarg_icon_color ,CASE WHEN pt.metric_type = 3 THEN ( CASE WHEN rdo.rating_defn_uid IS NOT NULL THEN rdo.rating_defn_uid ELSE rd.rating_defn_uid END ) ELSE NULL END AS oar_rating_defn_uid ,CASE WHEN pt.metric_type = 3 THEN ( CASE WHEN rdo.rating_defn_uid IS NOT NULL THEN rdo.name ELSE rd.name END ) ELSE NULL END AS oar_rating_name ,NULL AS oar_icon ,CASE WHEN pt.metric_type = 3 THEN ( CASE WHEN rdo.rating_defn_uid IS NOT NULL THEN rdo.rating_value ELSE rd.rating_value END ) ELSE NULL END AS oar_rating ,CASE WHEN pt.metric_type = 3 THEN ( CASE WHEN rdo.rating_defn_uid IS NOT NULL THEN rdo.rating_unit ELSE rd.rating_unit END ) ELSE NULL END AS oar_rating_unit ,CASE WHEN pt.metric_type = 3 THEN ( CASE WHEN rdo.rating_defn_uid IS NOT NULL THEN rdo.icon_content_type ELSE rd.icon_content_type END ) ELSE NULL END AS oar_icon_content_type ,CASE WHEN pt.metric_type = 3 THEN ( CASE WHEN rdo.rating_defn_uid IS NOT NULL THEN rdo.icon_name ELSE rd.icon_name END ) ELSE NULL END AS oar_icon_name ,CASE WHEN pt.metric_type = 3 THEN ( CASE WHEN rdo.rating_defn_uid IS NOT NULL THEN rdo.icon_url ELSE rd.icon_url END ) ELSE NULL END AS oar_icon_url ,CASE WHEN pt.metric_type = 3 THEN ( CASE WHEN rdo.rating_defn_uid IS NOT NULL THEN rdo.icon_color ELSE rd.icon_color END ) ELSE NULL END AS oar_icon_color ,f.metric_overridden AS is_overridden ,f.metric_overrideable AS metric_overrideable ,CASE WHEN o.objective_type = 2 THEN 1 ELSE 0 END AS is_manual_result ,CASE WHEN o.objective_type = 3 THEN 1 ELSE 0 END AS is_manual_rating ,f.target AS target ,f.target_unit AS target_unit ,f.trend_type AS trend_type ,f.trend_type_value AS trend_type_value ,fn_radisp_from_max_enddate( o.objective_uid ,mp.period_start_datetime ,mp.period_end_datetime ,f.metric_meas_period_type_uid ) AS rating_disp_flag ,fn_redisp_from_max_enddate( o.objective_uid ,mp.period_start_datetime ,mp.period_end_datetime ,f.metric_meas_period_type_uid ) AS result_disp_flag FROM performance_metric f INNER JOIN employee e ON( f.employee_uid = e.employee_uid AND e.employee_uid = ? ) INNER JOIN perf_metric_type pt ON( f.metric_type_uid = pt.metric_type_uid AND pt.metric_type <> 5 AND( pt.metric_type <> 4 OR pt.metric_type IS NULL ) ) INNER JOIN metric_meas_period_type mpt ON( f.metric_meas_period_type_uid = mpt.metric_meas_period_type_uid AND mpt.metric_meas_period_type_uid = ? ) INNER JOIN metric_measure_period mp ON( f.metric_meas_period_uid = mp.measure_period_uid AND mp.period_start_datetime <= ? AND ? < mp.period_end_datetime ) LEFT OUTER JOIN rating_defn rd ON( f.rating_defn_uid = rd.rating_defn_uid ) LEFT OUTER JOIN rating_defn rdo ON( f.ovrd_rating_defn_uid = rdo.rating_defn_uid ) LEFT OUTER JOIN experience_level el ON( f.experience_level_uid = el.experience_level_uid ) LEFT OUTER JOIN emp_group eg ON( f.emp_group_uid = eg.emp_group_uid ) LEFT OUTER JOIN manager_group mg ON( eg.emp_group_uid = mg.emp_group_uid AND mg.manager_group_id = fn_managerGrp_from_max_enddate( f.employee_uid ,f.emp_group_uid ,f.metric_start_datetime ,f.metric_end_datetime ) ) LEFT OUTER JOIN employee m ON( mg.manager_uid = m.employee_uid ) LEFT OUTER JOIN objective o ON( f.objective_uid = o.objective_uid ) LEFT OUTER JOIN objective_group og ON( f.objective_group_uid = og.objective_group_uid ) LEFT OUTER JOIN employee_group e_g ON( e.employee_uid = e_g.employee_uid AND e.employee_uid = ? AND eg.emp_group_uid = e_g.emp_group_uid AND f.metric_start_datetime < e_g.end_datetime AND f.metric_end_datetime > e_g.start_datetime AND e_g.end_datetime > e_g.start_datetime ) LEFT OUTER JOIN objective_class oc ON( o.class_id = oc.class_id ) LEFT OUTER JOIN OBJECTIVE_RATING_DISP_PERIOD oradp ON( o.objective_uid = oradp.objective_uid AND mpt.metric_meas_period_type_uid = oradp.metric_meas_period_type_uid AND mpt.metric_meas_period_type_uid = ? AND oradp.start_datetime < f.metric_end_datetime AND f.metric_start_datetime <= oradp.end_datetime AND oradp.start_datetime < oradp.end_datetime ) LEFT OUTER JOIN OBJECTIVE_RESULT_DISP_PERIOD oredp ON( o.objective_uid = oredp.objective_uid AND mpt.metric_meas_period_type_uid = oredp.metric_meas_period_type_uid AND mpt.metric_meas_period_type_uid = ? AND oredp.start_datetime < f.metric_end_datetime AND f.metric_start_datetime <= oredp.end_datetime AND oredp.start_datetime < oredp.end_datetime ) ) )
The actual query i used was like this :
SELECT {man.*} FROM (the union result of two individual queries -- as can be seen above )
I debugged the code and found that when the prepared statement tried to execute the query the exception occured.The prepared statement was an object of org.jboss.resource.adapter.jdbc.WrappedPreparedStatement
My work is stucked due to this problem.Any help will be highly appreciated.
Thanks,
Jignesh
[/b][/i]
|
|