升级到Payara 5 / ElipseLink 2.7.0后,已建立的JPQL查询不再有效

时间:2018-05-17 10:15:58

标签: jpa eclipselink jpql payara

我们有一个应用程序在带有EclipseLink 2.6.4的Payara 4上正常运行,但自从我们升级到Payara 5和EclipseLink 2.7.0后,我们注意到我们的几个命名的JPQL查询不再有效并抛出类似的异常。

一个示例查询如下所示:

SELECT an FROM ScoreCardFinder scf JOIN scf.assignmentNo an WHERE an.name=:name AND an.company=:company AND scf.scoreCard=:scoreCard

抛出以下异常:

Caused by: javax.persistence.PersistenceException: Exception [EclipseLink-26] (Eclipse Persistence Services - 2.7.0.v20170811-d680af5): org.eclipse.persistence.exceptions.DescriptorException
Exception Description: Trying to get value for instance variable [id] of type [java.lang.Short] from the object [de.otto.cccs.customerscoring_common.entities.AssignmentNo].  The specified object is not an instance of the class or interface declaring the underlying field.
Internal Exception: java.lang.IllegalArgumentException: Can not set java.lang.Short field de.otto.cccs.customerscoring_common.entities.ScoreCardFinder.id to de.otto.cccs.customerscoring_common.entities.AssignmentNo
Mapping: org.eclipse.persistence.mappings.DirectToFieldMapping[id-->SCORECARDFINDER.ID]
Descriptor: RelationalDescriptor(de.otto.cccs.customerscoring_common.entities.ScoreCardFinder --> [DatabaseTable(SCORECARDFINDER)])
        at org.eclipse.persistence.internal.jpa.QueryImpl.getResultList(QueryImpl.java:491)
        at com.sun.enterprise.container.common.impl.QueryWrapper.getResultList(QueryWrapper.java:84)
        at de.otto.cccs.customerscoring_common.entities.repos.AssignmentNoRepository.findByNameAndCompanyAndScoreCard(AssignmentNoRepository.java:34)

在我看来,EclipseLink以某种方式对ID字段的类型感到困惑并混淆了连接的两面,因为ScoreCardFinder的ID是Short类型,而AssignmentNo的ID是Integer类型。

异常似乎暗示EclipseLink试图从AssignmentNo实体获取Short类型的变量[id]。但这没有任何意义,要么它应该尝试从AssignmentNo获取一个Integer,要么从ScoreCardFinder获得一个Short。

对此处发生的任何暗示都将不胜感激。

提前感谢!

的问候, 马里奥

供参考我将附上以下两个实体的来源。

ScoreCardFinder:

package de.otto.cccs.customerscoring_common.entities;

import java.io.Serializable;
import java.util.Collection;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.QueryHint;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import javax.xml.bind.annotation.XmlTransient;

import org.eclipse.persistence.annotations.Cache;
import org.eclipse.persistence.annotations.CacheType;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.ToString;

@Entity
@Data
@EqualsAndHashCode(of = "id", callSuper=false)
@NoArgsConstructor
@RequiredArgsConstructor
@SequenceGenerator(name="SEQ_ScorecardFinder", initialValue=10, allocationSize=1)
@Cache(type=CacheType.FULL, size=250)
@Table(uniqueConstraints={
        @UniqueConstraint(columnNames = {"SCORINGVARIANT_ID", "ASSIGNMENTNO_ID"})
    }) 
@NamedQueries({
    @NamedQuery(name="ScoreCardFinder.findOne",
            query="SELECT scf FROM ScoreCardFinder AS scf WHERE scf.id=:id",
            hints={
                    @QueryHint(name="eclipselink.query-results-cache", value="true"),
                    @QueryHint(name="eclipselink.query-results-cache.size", value="250")
            }
    ),
    @NamedQuery(name="ScoreCardFinder.findByAssignmentNo",
        query="SELECT scf FROM ScoreCardFinder AS scf WHERE scf.assignmentNo=:assignmentNo",
        hints={
                @QueryHint(name="eclipselink.query-results-cache", value="true"),
                @QueryHint(name="eclipselink.query-results-cache.size", value="250")
        }
    ),
    @NamedQuery(name="ScoreCardFinder.findBy",
            query="SELECT scf "
                    + "FROM ScoreCardFinder AS scf "
                    + "JOIN scf.assignmentNo an "
                    + "JOIN an.assignmentNoFinders anf "
                    + "JOIN an.company c "
                    + "WHERE c.name=:companyName "
                    + "AND (:activationChannel=an.activationChannel OR an.activationChannel IS NULL) "
                    + "AND (anf.recruitmentCode=:recruitmentCode OR anf.recruitmentCode IS NULL) "
                    + "AND (anf.prospectRecruitmentCode=:prospectRecruitmentCode OR anf.prospectRecruitmentCode IS NULL) "
                    + "AND (:shopDomain=anf.shopDomain OR anf.shopDomain IS NULL) "
                    + "AND (:deviceType=anf.clientDeviceType OR anf.clientDeviceType IS NULL) "
                    + "AND anf.validFrom <= :now "
                    + "AND (anf.disableOn IS NULL OR anf.disableOn > :now) "
                    + "ORDER BY an.activationChannel DESC, anf.recruitmentCode DESC, anf.prospectRecruitmentCode DESC, anf.shopDomain DESC, anf.clientDeviceType DESC, anf.validFrom DESC"
                    ,

            hints={
                    @QueryHint(name="eclipselink.query-results-cache", value="true"),
                    @QueryHint(name="eclipselink.query-results-cache.size", value="250")
            }
    ),
    @NamedQuery(name="ScoreCardFinder.findByCompany",
        query="SELECT scf "
                + "FROM ScoreCardFinder AS scf "
                + "JOIN scf.assignmentNo an "
                + "JOIN an.assignmentNoFinders anf "
                + "WHERE an.company=:company "
                + "ORDER BY an.activationChannel, anf.recruitmentCode, anf.prospectRecruitmentCode, anf.validFrom DESC",

        hints={
                @QueryHint(name="eclipselink.query-results-cache", value="true"),
                @QueryHint(name="eclipselink.query-results-cache.size", value="250")
        }
    ),
    @NamedQuery(name="ScoreCardFinder.findByScoreCard",
        query="SELECT scf FROM ScoreCardFinder AS scf WHERE scf.scoreCard=:scoreCard",

        hints={
                @QueryHint(name="eclipselink.query-results-cache", value="true"),
                @QueryHint(name="eclipselink.query-results-cache.size", value="20")
        }
    )
})

@ToString(exclude={"custScoringResults","valueFinderSchedules"})
public class ScoreCardFinder extends CustomerScoringEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @Column(length=4, nullable=false, updatable=false)
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SEQ_ScorecardFinder")
    private Short id;

    @NonNull
    @ManyToOne(optional=false, cascade = CascadeType.PERSIST)
    private ScoreCard scoreCard;

    @NonNull
    @ManyToOne(optional=false)
    private AssignmentNo assignmentNo;

    @NonNull
    @ManyToOne(optional=false, cascade = CascadeType.PERSIST)
    private ScoringVariant scoringVariant;

    @OneToMany(mappedBy="scorecardFinder")
    private Collection<CustScoringResult> custScoringResults;

    @XmlTransient
    @ApiModelProperty(hidden=true)
    public Collection<CustScoringResult> getCustScoringResults() {
        return custScoringResults;
    }

    @OneToMany(mappedBy="scoreCardFinder")
    private Collection<ValueFinderSchedule> valueFinderSchedules;

    @XmlTransient
    @ApiModelProperty(hidden=true)
    public Collection<ValueFinderSchedule> getValueFinderSchedules() {
        return valueFinderSchedules;
    }

}

AssignmentNo:

package de.otto.cccs.customerscoring_common.entities;

import java.io.Serializable;
import java.util.Collection;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.QueryHint;
import javax.persistence.SequenceGenerator;
import javax.xml.bind.annotation.XmlTransient;

import org.eclipse.persistence.annotations.Cache;
import org.eclipse.persistence.annotations.CacheType;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.ToString;

@Entity
@Data
@EqualsAndHashCode(of = "id", callSuper=false)
@NoArgsConstructor
@RequiredArgsConstructor
@SequenceGenerator(name="SEQ_AssignmentNo", initialValue=10, allocationSize=1)
@Cache(type=CacheType.FULL, size=150)
@ToString(exclude={"assignmentNoFinders","scoreCardFinders"})
@NamedQueries({
    @NamedQuery(name="AssignmentNo.findOne",
            query="SELECT an FROM AssignmentNo AS an WHERE an.id=:id",
            hints={
                    @QueryHint(name="eclipselink.query-results-cache", value="true"),
                    @QueryHint(name="eclipselink.query-results-cache.size", value="100")
            }
    ),
    @NamedQuery(name="AssignmentNo.findByCompanyAndName",
                query="SELECT an FROM AssignmentNo AS an WHERE (:company IS NULL OR an.company=:company) AND (:name IS NULL OR an.name=:name)",
                hints={
                        @QueryHint(name="eclipselink.query-results-cache", value="true"),
                        @QueryHint(name="eclipselink.query-results-cache.size", value="50")
                }
    ),
    @NamedQuery(name="AssignmentNo.findByNameAndCompanyAndScoreCard",
        query="SELECT an FROM ScoreCardFinder scf JOIN scf.assignmentNo an WHERE an.name=:name AND an.company=:company AND scf.scoreCard=:scoreCard",
        hints={
                @QueryHint(name="eclipselink.query-results-cache", value="true"),
                @QueryHint(name="eclipselink.query-results-cache.size", value="50")
        }
    ),
    @NamedQuery(name="AssignmentNo.findAll",
                query="SELECT an FROM AssignmentNo AS an",
                hints={
                        @QueryHint(name="eclipselink.query-results-cache", value="true"),
                        @QueryHint(name="eclipselink.query-results-cache.size", value="1")
                }
    ),
})
public class AssignmentNo extends CustomerScoringEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    public AssignmentNo(String name, ActivationChannel activationChannel, Company company) {
        super();
        if (name == null) throw new NullPointerException("name");
        this.name = name;
        this.activationChannel = activationChannel;
        if (company == null) throw new NullPointerException("company");
        this.company = company;
    }

    @Id
    @Column(length=6, nullable=false, updatable=false)
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SEQ_AssignmentNo")
    private Integer id;

    @NonNull
    @Column(length = 50, nullable=false)
    private String name;

    @ManyToOne(optional=true, cascade = CascadeType.PERSIST)
    private ActivationChannel activationChannel;

    @NonNull
    @ManyToOne(optional=false)
    private Company company;

    @OneToMany(mappedBy="assignmentNo")
    private Collection<AssignmentNoFinder> assignmentNoFinders;

    @XmlTransient
    @ApiModelProperty(hidden=true)
    public Collection<AssignmentNoFinder> getAssignmentNoFinders() {
        return assignmentNoFinders;
    }

    @OneToMany(mappedBy="assignmentNo")
    private Collection<ScoreCardFinder> scoreCardFinders;

    @XmlTransient
    @ApiModelProperty(hidden=true)
    public Collection<ScoreCardFinder> getScoreCardFinders() {
        return scoreCardFinders;
    }
}

要求我也提供完整的堆栈跟踪:

org.jboss.weld.exceptions.WeldException: WELD-000049: Unable to invoke public void de.otto.cccs.customerscoring.gui.views.assignments.AssignmentsView.postConstruct() on de.otto.cccs.customerscoring.gui.views.assignments.AssignmentsView@3878cc8d
        at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.invokeMethods(DefaultLifecycleCallbackInvoker.java:85)
        at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.postConstruct(DefaultLifecycleCallbackInvoker.java:66)
        at org.jboss.weld.injection.producer.BasicInjectionTarget.postConstruct(BasicInjectionTarget.java:122)
        at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:162)
        at org.apache.deltaspike.core.util.context.ContextualStorage.createContextualInstance(ContextualStorage.java:131)
        at org.apache.deltaspike.core.util.context.AbstractContext.get(AbstractContext.java:129)
        at com.vaadin.cdi.internal.ContextWrapper.get(ContextWrapper.java:51)
        at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:100)
        at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
        at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:689)
        at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:712)
        at org.apache.deltaspike.core.api.provider.BeanProvider.getContextualReference(BeanProvider.java:497)
        at org.apache.deltaspike.core.api.provider.BeanProvider.getContextualReference(BeanProvider.java:274)
        at org.apache.deltaspike.core.api.provider.BeanProvider.getContextualReference(BeanProvider.java:268)
        at com.vaadin.cdi.internal.ViewContextualStorageManager.prepareChange(ViewContextualStorageManager.java:71)
        at com.vaadin.cdi.internal.ViewContextualStorageManager$Proxy$_$$_WeldClientProxy.prepareChange(Unknown Source)
        at com.vaadin.cdi.CDIViewProvider.getView(CDIViewProvider.java:226)
        at com.vaadin.navigator.Navigator.navigateTo(Navigator.java:652)
        at de.otto.cccs.customerscoring.gui.composites.MenuBarComposite$5.menuSelected(MenuBarComposite.java:127)
        at com.vaadin.ui.MenuBar.changeVariables(MenuBar.java:206)
        at com.vaadin.server.communication.ServerRpcHandler.changeVariables(ServerRpcHandler.java:625)
        at com.vaadin.server.communication.ServerRpcHandler.handleInvocation(ServerRpcHandler.java:471)
        at com.vaadin.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:414)
        at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:274)
        at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:90)
        at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40)
        at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1601)
        at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:445)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:791)
        at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1622)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:339)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:209)
        at org.glassfish.tyrus.servlet.TyrusServletFilter.doFilter(TyrusServletFilter.java:305)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:251)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:209)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:654)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:593)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:159)
        at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:371)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:238)
        at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:516)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:213)
        at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206)
        at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180)
        at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:242)
        at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
        at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
        at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:539)
        at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:593)
        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:573)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.reflect.InvocationTargetException
        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.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.invokeMethods(DefaultLifecycleCallbackInvoker.java:83)
        ... 61 more
Caused by: javax.persistence.PersistenceException: Exception [EclipseLink-26] (Eclipse Persistence Services - 2.7.0.v20170811-d680af5): org.eclipse.persistence.exceptions.DescriptorException
Exception Description: Trying to get value for instance variable [id] of type [java.lang.Short] from the object [de.otto.cccs.customerscoring_common.entities.AssignmentNo].  The specified object is not an instance of the class or interface declaring the underlying field.
Internal Exception: java.lang.IllegalArgumentException: Can not set java.lang.Short field de.otto.cccs.customerscoring_common.entities.ScoreCardFinder.id to de.otto.cccs.customerscoring_common.entities.AssignmentNo
Mapping: org.eclipse.persistence.mappings.DirectToFieldMapping[id-->SCORECARDFINDER.ID]
Descriptor: RelationalDescriptor(de.otto.cccs.customerscoring_common.entities.ScoreCardFinder --> [DatabaseTable(SCORECARDFINDER)])
        at org.eclipse.persistence.internal.jpa.QueryImpl.getResultList(QueryImpl.java:491)
        at com.sun.enterprise.container.common.impl.QueryWrapper.getResultList(QueryWrapper.java:84)
        at de.otto.cccs.customerscoring_common.entities.repos.AssignmentNoRepository.findByNameAndCompanyAndScoreCard(AssignmentNoRepository.java:34)
        at de.otto.cccs.customerscoring.gui.views.assignments.AssignmentsModel.getAssignmentNosWithNameForCompanyAndScorecard(AssignmentsModel.java:167)
        at de.otto.cccs.customerscoring.gui.views.assignments.AssignmentsModel$Proxy$_$$_WeldSubclass.getAssignmentNosWithNameForCompanyAndScorecard(Unknown Source)
        at de.otto.cccs.customerscoring.gui.views.assignments.AssignmentsView.updateAssignments(AssignmentsView.java:884)
        at de.otto.cccs.customerscoring.gui.views.assignments.AssignmentsView.refreshView(AssignmentsView.java:870)
        at de.otto.cccs.customerscoring.gui.views.assignments.AssignmentsView.postConstruct(AssignmentsView.java:497)
        ... 66 more
Caused by: Exception [EclipseLink-26] (Eclipse Persistence Services - 2.7.0.v20170811-d680af5): org.eclipse.persistence.exceptions.DescriptorException
Exception Description: Trying to get value for instance variable [id] of type [java.lang.Short] from the object [de.otto.cccs.customerscoring_common.entities.AssignmentNo].  The specified object is not an instance of the class or interface declaring the underlying field.
Internal Exception: java.lang.IllegalArgumentException: Can not set java.lang.Short field de.otto.cccs.customerscoring_common.entities.ScoreCardFinder.id to de.otto.cccs.customerscoring_common.entities.AssignmentNo
Mapping: org.eclipse.persistence.mappings.DirectToFieldMapping[id-->SCORECARDFINDER.ID]
Descriptor: RelationalDescriptor(de.otto.cccs.customerscoring_common.entities.ScoreCardFinder --> [DatabaseTable(SCORECARDFINDER)])
        at org.eclipse.persistence.exceptions.DescriptorException.illegalArgumentWhileGettingValueThruInstanceVariableAccessor(DescriptorException.java:648)
        at org.eclipse.persistence.internal.descriptors.InstanceVariableAttributeAccessor.getAttributeValueFromObject(InstanceVariableAttributeAccessor.java:84)
        at org.eclipse.persistence.mappings.DatabaseMapping.getAttributeValueFromObject(DatabaseMapping.java:689)
        at org.eclipse.persistence.mappings.foundation.AbstractDirectMapping.valueFromObject(AbstractDirectMapping.java:1178)
        at org.eclipse.persistence.internal.descriptors.ObjectBuilder.extractPrimaryKeyFromObject(ObjectBuilder.java:3021)
        at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.registerExistingObject(UnitOfWorkImpl.java:4031)
        at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:451)
        at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1268)
        at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2979)
        at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1892)
        at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1874)
        at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1839)
        at org.eclipse.persistence.internal.jpa.QueryImpl.executeReadQuery(QueryImpl.java:260)
        at org.eclipse.persistence.internal.jpa.QueryImpl.getResultList(QueryImpl.java:480)
        ... 73 more
Caused by: java.lang.IllegalArgumentException: Can not set java.lang.Short field de.otto.cccs.customerscoring_common.entities.ScoreCardFinder.id to de.otto.cccs.customerscoring_common.entities.AssignmentNo
        at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167)
        at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171)
        at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:58)
        at sun.reflect.UnsafeObjectFieldAccessorImpl.get(UnsafeObjectFieldAccessorImpl.java:36)
        at java.lang.reflect.Field.get(Field.java:393)
        at org.eclipse.persistence.internal.descriptors.InstanceVariableAttributeAccessor.getAttributeValueFromObject(InstanceVariableAttributeAccessor.java:81)
        ... 85 more

0 个答案:

没有答案