ORA-00942: table or view does not exist org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet

huangapple go评论94阅读模式
英文:

ORA-00942: table or view does not exist org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet

问题

不确定我漏掉了什么,但当我在ORM中添加一个具有2个 @id 列的 SEMPLOYEES 表时,我会遇到这个错误。当我在ORM查询中使用 SEMPLYEES 表时,我会遇到这个错误。服务在没有 SEMPLOYEES 的情况下正常工作,但我必须从这个表中获取一些数据,所以我必须使用它。任何帮助将不胜感激。谢谢!

我的实体类

package com.paychex.hrs.riskassessment.entity;

import javax.persistence.*;
import com.paychex.hrs.riskassessment.entity.keys.SEmployeesPK;

@Entity
@Table(name = "SEMPLOYEES", schema = "HRIS")
@IdClass(SEmployeesPK.class)
public class SEmployees {

  @Id
  @Column(name = "SEE_CLT_ID")
  private Long seeCltId;

  @Id
  @Column(name = "SEE_EMP_NBR")
  private Integer seeEmpNbr;

  @Column(name = "SEE_LAST_NAME")
  private String seeLastName;

  @Column(name = "SEE_FIRST_NAME")
  private String seeFirstName;

  // ... 省略其他属性和方法 ...
}

主键类

package com.paychex.hrs.riskassessment.entity.keys;

import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;

public class SEmployeesPK implements Serializable {

   private static final long serialVersionUID = 42L;

   @Id
   @Column(name = "SEE_CLT_ID")
   private Long seeCltId;

   @Id
   @Column(name = "SEE_EMP_NBR")
   private Integer seeEmpNbr;

   // ... 省略构造函数和其他方法 ...
}

ORM查询

<named-native-query name="DistributionRiskAssessmentHeader.getDistributionRiskAssessmentHeader" result-class="com.paychex.hrs.riskassessment.entity.DistributionRiskAssessmentHeader">
    <description>获取分发风险评估头数据</description>
    <query>
    <![CDATA[
     SELECT DR_DISTRIB_ID,
            ED_PMT_METHOD,
            ED_HOLD_FLAG,
            DR_CREATED_DATE,
            HH_ID,
            DR_SSN,
            ED_PAYEE_FIRST_NAME,
            ED_PAYEE_LAST_NAME
       FROM KIS.DISTRIBUTION_REQUESTS,
            KIS.EMPLOYEE_DISTRIBUTIONS,
            LNDRISK.HISTORY_HEADER,
            HRIS.SEMPLOYEEPLAN,
            HRIS.SEMPLOYEES
      WHERE DR_DISTRIB_ID = :in_distribution_id ...
    ]]>
    </query>
</named-native-query>

Repository

package com.paychex.hrs.riskassessment.entity.repository;

import org.springframework.data.repository.CrudRepository;
import com.paychex.hrs.riskassessment.entity.SEmployees;
import com.paychex.hrs.riskassessment.entity.keys.SEmployeesPK;

public interface SEmployeesRepository extends CrudRepository<SEmployees, SEmployeesPK> {
}

错误

[ERROR] 2020-04-05 21:54:22 o.h.e.j.s.SqlExceptionHelper [http-nio-8084-exec-1]: ORA-00942: 表或视图不存在
...

注意:由于您要求只翻译代码部分,我只翻译了与代码相关的部分,其他的内容未做翻译。如果您需要进一步的帮助,请随时提问。

英文:

Not sure what I am missing but when I add a table SEMPLOYEES in orm which has 2 @id columns, I get this error. I get this error when I use SEMPLYEES table in ORM query. Service works fine without SEMPLOYEES in ORM query but I have to get some data from this table so I have to use this. Any help will be appreciated. Thanks!

My entity class

package com.paychex.hrs.riskassessment.entity;

import javax.persistence.*;
import com.paychex.hrs.riskassessment.entity.keys.SEmployeesPK;

@Entity
@Table(name = &quot;SEMPLOYEES&quot;, schema = &quot;HRIS&quot;)
@IdClass(SEmployeesPK.class)
public class SEmployees {

  @Id
  @Column(name = &quot;SEE_CLT_ID&quot;)
  private Long seeCltId;

  @Id
  @Column(name = &quot;SEE_EMP_NBR&quot;)
  private Integer seeEmpNbr;

  @Column(name = &quot;SEE_LAST_NAME&quot;)
  private String seeLastName;

  @Column(name = &quot;SEE_FIRST_NAME&quot;)
  private String seeFirstName;
  

  
	public Long getSeeCltId() {
		return seeCltId;
	}
	public void setSeeCltId(Long seeCltId) {
		this.seeCltId = seeCltId;
	}
	public Integer getSeeEmpNbr() {
		return seeEmpNbr;
	}
	public void setSeeEmpNbr(Integer seeEmpNbr) {
		this.seeEmpNbr = seeEmpNbr;
	}
	public String getSeeLastName() {
		return seeLastName;
	}
	public void setSeeLastName(String seeLastName) {
		this.seeLastName = seeLastName;
	}
	public String getSeeFirstName() {
		return seeFirstName;
	}
	public void setSeeFirstName(String seeFirstName) {
		this.seeFirstName = seeFirstName;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((seeCltId == null) ? 0 : seeCltId.hashCode());
		result = prime * result + ((seeEmpNbr == null) ? 0 : seeEmpNbr.hashCode());
		result = prime * result + ((seeFirstName == null) ? 0 : seeFirstName.hashCode());
		result = prime * result + ((seeLastName == null) ? 0 : seeLastName.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		SEmployees other = (SEmployees) obj;
		if (seeCltId == null) {
			if (other.seeCltId != null)
				return false;
		} else if (!seeCltId.equals(other.seeCltId))
			return false;
		if (seeEmpNbr == null) {
			if (other.seeEmpNbr != null)
				return false;
		} else if (!seeEmpNbr.equals(other.seeEmpNbr))
			return false;
		if (seeFirstName == null) {
			if (other.seeFirstName != null)
				return false;
		} else if (!seeFirstName.equals(other.seeFirstName))
			return false;
		if (seeLastName == null) {
			if (other.seeLastName != null)
				return false;
		} else if (!seeLastName.equals(other.seeLastName))
			return false;
		return true;
	}
	@Override
	public String toString() {
		return &quot;SEmployees [seeCltId=&quot; + seeCltId + &quot;, seeEmpNbr=&quot; + seeEmpNbr + &quot;, seeLastName=&quot; + seeLastName
				+ &quot;, seeFirstName=&quot; + seeFirstName + &quot;]&quot;;
	} 
}

===========================================================================================================

package com.paychex.hrs.riskassessment.entity.keys;

import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;

public class SEmployeesPK implements Serializable {

   private static final long serialVersionUID = 42L;

   @Id
   @Column(name = &quot;SEE_CLT_ID&quot;)
   private Long seeCltId;

   @Id
   @Column(name = &quot;SEE_EMP_NBR&quot;)
   private Integer seeEmpNbr;

   public SEmployeesPK() {
   }

   public SEmployeesPK(Long seeCltId, Integer seeEmpNbr) {
      this.seeCltId = seeCltId;
      this.seeEmpNbr = seeEmpNbr;
   }

   public Long getSeeCltId() {
      return this.seeCltId;
   }

   public void setSeeCltId(Long seeCltId) {
      this.seeCltId = seeCltId;
   }

   public Integer getSeeEmpNbr() {
      return this.seeEmpNbr;
   }

   public void setSeeEmpNbr(Integer seeEmpNbr) {
      this.seeEmpNbr = seeEmpNbr;
   }



   @Override
   public int hashCode() {
      final int prime = 31;
      int result = 1;
      result = prime * result + ((seeCltId == null) ? 0 : seeCltId.hashCode());
      result = prime * result + ((seeEmpNbr == null) ? 0 : seeEmpNbr.hashCode());
      return result;
   }

   @Override
   public boolean equals(Object obj) {
      if (this == obj)
         return true;
      if (obj == null)
         return false;
      if (getClass() != obj.getClass())
         return false;
      SEmployeesPK other = (SEmployeesPK) obj;
      if (seeCltId == null) {
         if (other.seeCltId != null)
            return false;
      } else if (!seeCltId.equals(other.seeCltId))
         return false;
      if (seeEmpNbr == null) {
         if (other.seeEmpNbr != null)
            return false;
      } else if (!seeEmpNbr.equals(other.seeEmpNbr))
         return false;
      return true;
   }

	@Override
	public String toString() {
		return &quot;SEmployeesPK [seeCltId=&quot; + seeCltId + &quot;, seeEmpNbr=&quot; + seeEmpNbr + &quot;]&quot;;
	} 
   
}

========================================================================

ORM

&lt;named-native-query name=&quot;DistributionRiskAssessmentHeader.getDistributionRiskAssessmentHeader&quot; result-class=&quot;com.paychex.hrs.riskassessment.entity.DistributionRiskAssessmentHeader&quot;&gt;
    &lt;description&gt;Get distribution risk assessment header data&lt;/description&gt;
    &lt;query&gt;
    &lt;![CDATA[
     SELECT DR_DISTRIB_ID,
            ED_PMT_METHOD,
            ED_HOLD_FLAG,
            DR_CREATED_DATE,
            HH_ID,
            DR_SSN,
            ED_PAYEE_FIRST_NAME,
            ED_PAYEE_LAST_NAME
       FROM KIS.DISTRIBUTION_REQUESTS,
            KIS.EMPLOYEE_DISTRIBUTIONS,
            LNDRISK.HISTORY_HEADER,
            HRIS.SEMPLOYEEPLAN,
            HRIS.SEMPLOYEES
      WHERE DR_DISTRIB_ID = :in_distribution_id`enter code here`
	        AND ED_DISTRIB_ID = DR_DISTRIB_ID
	        AND HH_DISBURSEMENT_ID = DR_DISTRIB_ID
	        AND ED_PLAN_ID = SEP_PLAN_ID
	        AND SEP_CLT_ID = SEE_CLT_ID
	        AND SEP_EMP_NBR = SEE_EMP_NBR
    ]]&gt;
    &lt;/query&gt;
  &lt;/named-native-query&gt;



========================================================================================

Repository

package com.paychex.hrs.riskassessment.entity.repository;

import org.springframework.data.repository.CrudRepository;
import com.paychex.hrs.riskassessment.entity.SEmployees;
import com.paychex.hrs.riskassessment.entity.keys.SEmployeesPK;

public interface SEmployeesRepository extends CrudRepository&lt;SEmployees, SEmployeesPK&gt; {
}

====================================================================================================

Error

[ERROR] 2020-04-05 21:54:22 o.h.e.j.s.SqlExceptionHelper [http-nio-8084-exec-1]: ORA-00942: table or view does not exist
[ERROR] 2020-04-05 21:54:22 c.p.h.r.q.DistributionRiskAssessmentHistoryQueryHandler [http-nio-8084-exec-1]: org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested
exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:279)
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:253)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:527)
at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:61)
at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:242)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:153)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:144)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$ExposeRepositoryInvocationInterceptor.invoke(CrudMethodMetadataPostProcessor.java:364)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:61)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
at com.sun.proxy.$Proxy162.getDistributionRiskAssessmentHeader(Unknown Source)
at com.paychex.hrs.riskassessment.query.DistributionRiskAssessmentHistoryQueryHandler.handle(DistributionRiskAssessmentHistoryQueryHandler.java:82)
at com.paychex.hrs.riskassessment.query.DistributionRiskAssessmentHistoryQueryHandler.handle(DistributionRiskAssessmentHistoryQueryHandler.java:43)
at com.paychex.serviceframework.query.impl.RegisteredQueryHandlerDispatcher.dispatch(RegisteredQueryHandlerDispatcher.java:93)
at com.paychex.serviceframework.query.QueryDispatcherImpl.dispatch(QueryDispatcherImpl.java:25)
at com.paychex.serviceframework.query.QueryProcessorImpl.execute(QueryProcessorImpl.java:38)
at com.paychex.serviceframework.query.QueryProcessorImpl.execute(QueryProcessorImpl.java:32)
at com.paychex.hrs.distributionmanager.rest.DistributionRiskAssessmentController.getDistributionRiskAssessment(DistributionRiskAssessmentController.java:66)
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.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:892)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1039)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:897)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.boot.actuate.web.trace.servlet.HttpTraceFilter.doFilterInternal(HttpTraceFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.filterAndRecordMetrics(WebMvcMetricsFilter.java:114)
at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:104)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:526)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:860)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1587)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:63)
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:99)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:69)
at org.hibernate.loader.Loader.getResultSet(Loader.java:2265)
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2028)
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1990)
at org.hibernate.loader.Loader.doQuery(Loader.java:949)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:351)
at org.hibernate.loader.Loader.doList(Loader.java:2787)
at org.hibernate.loader.Loader.doList(Loader.java:2770)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2604)
at org.hibernate.loader.Loader.list(Loader.java:2599)
at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:338)
at org.hibernate.internal.SessionImpl.listCustomQuery(SessionImpl.java:2254)
at org.hibernate.internal.AbstractSharedSessionContract.list(AbstractSharedSessionContract.java:1069)
at org.hibernate.query.internal.NativeQueryImpl.doList(NativeQueryImpl.java:170)
at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1506)
at org.hibernate.query.Query.getResultList(Query.java:132)
at org.springframework.data.jpa.repository.query.JpaQueryExecution$CollectionExecution.doExecute(JpaQueryExecution.java:129)
at org.springframework.data.jpa.repository.query.JpaQueryExecution.execute(JpaQueryExecution.java:91)
at org.springframework.data.jpa.repository.query.AbstractJpaQuery.doExecute(AbstractJpaQuery.java:136)
at org.springframework.data.jpa.repository.query.AbstractJpaQuery.execute(AbstractJpaQuery.java:125)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:605)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.lambda$invoke$3(RepositoryFactorySupport.java:595)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:595)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:59)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139)
... 81 more
Caused by: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:494)
at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:446)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1052)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:537)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:255)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:610)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:253)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:86)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:765)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:921)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1099)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3640)
at oracle.jdbc.driver.T4CPreparedStatement.executeInternal(T4CPreparedStatement.java:1384)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3687)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1165)
at oracle.ucp.jdbc.proxy.oracle$1ucp$1jdbc$1proxy$1StatementProxy$2oracle$1jdbc$1internal$1OraclePreparedStatement$$$Proxy.executeQuery(Unknown Source)
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 com.paychex.hrs.traceability.dao.jdbc.StatementTracer.log(StatementTracer.java:129)
at com.paychex.hrs.traceability.dao.jdbc.StatementTracer.invoke(StatementTracer.java:76)
at com.sun.proxy.$Proxy211.executeQuery(Unknown Source)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:60)
... 110 more
Caused by: Error : 942, Position : 222, Sql = SELECT DR_DISTRIB_ID, ED_PMT_METHOD, ED_HOLD_FLAG, DR_CREATED_DATE, HH_ID, DR_SSN, SEE_FIRST_NAME, SEE_LAST_NAME FROM KIS.DISTRIBUTION_REQUESTS, KIS.EMPLOYEE_DISTRIBUTIONS,
LNDRISK.HISTORY_HEADER, HRIS.SEMPLOYEEPLAN, and bla bla bla ........

答案1

得分: 1

如果您希望为您的对象使用多个标识符,您应该使用 @EmbeddedId。

此外,@Embeddable 应该存在于通过 @EmbeddedId 注入的类上。

请参考示例:

http://www.thejavageek.com/2014/05/01/jpa-embeddedid-example/

英文:

If you want to use several identifiers for your object , you should use @EmbeddedId

https://docs.oracle.com/javaee/6/api/javax/persistence/EmbeddedId.html

Also @Embeddable should be present on class which would be injected via @EmbeddedId

Please refer to example:

http://www.thejavageek.com/2014/05/01/jpa-embeddedid-example/

答案2

得分: 0

因为你在作为 SEmployees 的 Id 的类上使用了 @Id 注解,我认为问题出在这里。
尝试将 SEmployeesPK 修改为:

public class SEmployeesPK implements Serializable {
private static final long serialVersionUID = 42L;
private Long seeCltId;
private Integer seeEmpNbr;
.
.
.

错误可能是由于 SEmployeesPK 表不存在引起的。

希望能对你有所帮助,祝你好运。

英文:

I believe it is because you are using @Id on the class used as Id for SEmployees.
try modifying SEmployeesPK to:

public class SEmployeesPK implements Serializable {
private static final long serialVersionUID = 42L;
private Long seeCltId;
private Integer seeEmpNbr;
.
.
.

The error must have been caused because SEmployeesPK table does not exists.

Hope this help, good luck.

答案3

得分: 0

问题可能出在不同的表(可能不存在,或者授予权限不在该表上)映射的外键或同义词上。

对我来说,问题出在那个表中的某个列,它与另一个架构表中的列有映射关系,而且缺失了,例如,public 同义词。

英文:

Issue could be with different table(might not exists or grant privilege is not for that table) mapped due to foreign key or synonym.

For me the issue was with a column in that table which had mapping with another schema-table, and it was missing.ex, public-synonym.

huangapple
  • 本文由 发表于 2020年4月6日 05:15:05
  • 转载请务必保留本文链接:https://go.coder-hub.com/61049588.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定