gpt4 book ai didi

java - 打开 JPA : MetaDataException After upgrading to Open JPA 2. 4.1 和 Java 8

转载 作者:行者123 更新时间:2023-11-30 07:11:43 25 4
gpt4 key购买 nike

我将我的 java 应用程序升级到 Open JPA 2.4.1 和 Java 8 & 我收到以下错误。以前我使用的是 Open JPA 2.2.2 和 Java 7。请注意,错误文本“表中不存在目标”不是 true,该字段位于表中。

有什么想法吗?

<openjpa-2.4.1-r422266:1730418 fatal user error> org.apache.openjpa.util.MetaDataException: "com.test.app.persistence.TblfeeFeeDtl.tblfeeFee" defines a target of "pay_id" for column "pay_id", but that target does not exist in table "dbo.tbl_sfee_fee".
org.apache.openjpa.jdbc.meta.MappingInfo.mergeJoinColumn(MappingInfo.java:1543)
org.apache.openjpa.jdbc.meta.MappingInfo.createJoins(MappingInfo.java:1323)
org.apache.openjpa.jdbc.meta.MappingInfo.createForeignKey(MappingInfo.java:1085)
org.apache.openjpa.jdbc.meta.ValueMappingInfo.getTypeJoin(ValueMappingInfo.java:115)
org.apache.openjpa.jdbc.meta.ValueMappingInfo.getTypeJoin(ValueMappingInfo.java:92)
org.apache.openjpa.jdbc.meta.strats.RelationFieldStrategy.map(RelationFieldStrategy.java:166)
org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(FieldMapping.java:148)
org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:81)
org.apache.openjpa.jdbc.meta.FieldMapping.resolveMapping(FieldMapping.java:498)
org.apache.openjpa.jdbc.meta.FieldMapping.resolve(FieldMapping.java:463)
org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.map(RelationToManyInverseKeyFieldStrategy.java:135)
org.apache.openjpa.jdbc.meta.strats.RelationCollectionInverseKeyFieldStrategy.map(RelationCollectionInverseKeyFieldStrategy.java:94)
org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(FieldMapping.java:148)
org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:81)
org.apache.openjpa.jdbc.meta.FieldMapping.resolveMapping(FieldMapping.java:498)
org.apache.openjpa.jdbc.meta.FieldMapping.resolve(FieldMapping.java:463)
org.apache.openjpa.jdbc.meta.ClassMapping.resolveMapping(ClassMapping.java:854)
org.apache.openjpa.meta.ClassMetaData.resolve(ClassMetaData.java:1813)
org.apache.openjpa.meta.MetaDataRepository.processBuffer(MetaDataRepository.java:829)
org.apache.openjpa.meta.MetaDataRepository.resolveMapping(MetaDataRepository.java:784)
org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:664)
org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal(MetaDataRepository.java:418)
org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:389)
org.apache.openjpa.persistence.meta.MetamodelImpl.<init>(MetamodelImpl.java:86)
org.apache.openjpa.persistence.EntityManagerFactoryImpl.getMetamodel(EntityManagerFactoryImpl.java:348)
org.apache.openjpa.persistence.EntityManagerFactoryImpl.getCriteriaBuilder(EntityManagerFactoryImpl.java:332)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.invokeProxyMethod(AbstractEntityManagerFactoryBean.java:462)
org.springframework.orm.jpa.AbstractEntityManagerFactoryBean$ManagedEntityManagerFactoryInvocationHandler.invoke(AbstractEntityManagerFactoryBean.java:633)
com.sun.proxy.$Proxy63.getCriteriaBuilder(Unknown Source)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:226)
com.sun.proxy.$Proxy88.getCriteriaBuilder(Unknown Source)
com.test.app.DataBCImpl.getTblPpwsUserGroupDtls(PricingDataBCImpl.java:3078)
com.test.app.DataBCImpl$$FastClassBySpringCGLIB$$99f8efb3.invoke(<generated>)
org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:280)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:52)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.cache.interceptor.CacheInterceptor$1.invoke(CacheInterceptor.java:52)
org.springframework.cache.interceptor.CacheAspectSupport.invokeOperation(CacheAspectSupport.java:345)
org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:414)
org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:327)
org.springframework.cache.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:61)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655)
com.test.app.DataBCImpl$$EnhancerBySpringCGLIB$$1735a68a.getTblPpwsUserGroupDtls(<generated>)
com.test.app.common.RoleMapperGrantedAuthorityFactory.createGrantedAuthority(RoleMapperGrantedAuthorityFactory.java:36)
waffle.spring.WindowsAuthenticationToken.<init>(WindowsAuthenticationToken.java:84)
waffle.spring.NegotiateSecurityFilter.doFilter(NegotiateSecurityFilter.java:108)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:100)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:66)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214)
org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)

最佳答案

我解决了这个问题。下面列出的“tblfeeFee”表的映射是问题所在。有问题的字段是多列 FK 关系的一部分,并且出于某种原因,Open JPA 2.4.1 对此比以前的版本更加挑剔。我需要在该表的映射中明确定义相关字段。

com.test.app.persistence.TblfeeFeeDtl.tblfeeFee defines a target of "pay_id" for column "pay_id", but that target does not exist in table "dbo.tbl_sfee_fee".

关于java - 打开 JPA : MetaDataException After upgrading to Open JPA 2. 4.1 和 Java 8,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39125302/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com