gpt4 book ai didi

sap-commerce-cloud - java.lang.IllegalArgumentException : invalid pks [10] - unknown typecode 0 异常

转载 作者:行者123 更新时间:2023-12-05 01:46:01 24 4
gpt4 key购买 nike

我正在尝试从 DAO 层触发灵活搜索查询。我的查询是这样的:

SELECT {loyaltypoints},{redeemedloyaltypoints}  
FROM {LoyaltyUser}
WHERE {uid} =?uid

向我抛出未知类型代码,但我的类型代码是正确的。我看到类似

的堆栈跟踪消息
SEVERE: Servlet.service() for servlet [DispatcherServlet] in context with path [/store]
threw exception [Request processing failed; nested exception is java.lang.IllegalArgumentException:
invalid pks [10] - unknown typecode 0] with root cause
java.lang.IllegalArgumentException: invalid pks [10] - unknown typecode 0
at de.hybris.platform.core.WrapperFactory.getCachedItems(WrapperFactory.java:304)
at de.hybris.platform.core.LazyLoadItemList.loadPage(LazyLoadItemList.java:230)
at de.hybris.platform.servicelayer.search.impl.LazyLoadModelList.loadPage(LazyLoadModelList.java)"

我的 items.xml 看起来像:

<itemtype code="LoyaltyUser" extends="Customer" autocreate="true" generate="true"
jaloclass="de.hybris.merchandise.core.jalo.LoyaltyUser">
<deployment table="LoyaltyUsers" typecode="10010"/>
<attributes>
<attribute generate="true" autocreate="true" qualifier="loyaltypoints" type="java.lang.Integer" >
&ltdescription&gtLoyalty points given for each purchase&lt/description&gt
<modifiers read="true" write="true" search="true" optional="true" />
<defaultvalue>Integer.valueOf(0)</defaultvalue>
<persistence type="property"/>
</attribute>
<attribute generate="true" autocreate="true" qualifier="redeemedloyaltypoints" type="java.lang.Integer" >
<description>Redeemed Loyalty points For a customer</description>
<modifiers read="true" write="true" search="true" optional="true" />
<defaultvalue>Integer.valueOf(0)</defaultvalue>
<persistence type="property"/>
</attribute>
</attributes>
</itemtype>

谁能帮我解决这个问题?

最佳答案

与其在查询中获取两个属性 {loyaltypoints},{redeemedloyaltypoints},不如获取 LoyaltyUser 模型的 PK。

SELECT {pk} FROM {LoyaltyUser} WHERE {uid} =?uid

查询会给出 LoyaltyUserModel 然后你可以通过 getter 方法获取它的属性。

Integer loyalyPoint = loyaltyUserModel.getLoyaltypoints()
Integer redeemedLoyaltyPoint = loyaltyUserModel.getRedeemedloyaltypoints()

关于sap-commerce-cloud - java.lang.IllegalArgumentException : invalid pks [10] - unknown typecode 0 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38392003/

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