[
https://issues.apache.org/jira/browse/OPENJPA-886?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Catalina Wei updated OPENJPA-886:
---------------------------------
Attachment: TestSetParameter.java
Pinaki,
The attached file contains a simple query string that could help you debugging
the problem:
String query = "UPDATE CompUser e set e.name= ?1, e.age = ?2 WHERE
e.userid = ?3";
int count = em.createQuery(query).
setParameter(1, "Shannon").
setParameter(2, 29).
setParameter(3, userid2).
executeUpdate();
You could add a version column to CompUser entity for non-user parameter.
> Certain query failing after svn:739123
> --------------------------------------
>
> Key: OPENJPA-886
> URL: https://issues.apache.org/jira/browse/OPENJPA-886
> Project: OpenJPA
> Issue Type: Bug
> Components: kernel
> Affects Versions: 2.0.0
> Reporter: Fernando
> Priority: Blocker
> Attachments: TestSetParameter.java
>
>
> We were using the nightly snapshot builds, then this morning our app stopped
> working. A certain query ( it looks quite normal to me ), fails, and we have
> no clue what's going on.
> The stack trace is below. It complains that a parameter type is not allowed,
> even though it has been working until that check-in. And the type is a
> normal Entity, related through a ManyToOne relationship from the other
> class.. The class code excerpts are below as well..
> 2009-01-30 11:43:31,349 [btpool0-1] DEBUG openjpa.Query - Executing query:
> [SELECT t0.JDOID, t0.CREATETIME, t0.BRACKET_JDOID, t0.GROUP0, t0.USER_JDOID
> FROM BRACKETEER t0 WHERE (t0.GROUP0 = ? AND t0.USER_JDOID = ?)] with
> parameters: {1=com.protrade.bracket.data.entities.u...@b1406b[
> fbId=578696943
> appAdded=false
> recruiter=<null>
> numMinibrackets=0
> numBrackets=0
> createTime=1233343722122
> idLong=9000
> jdoId=<null>
> jdoversion=0
> ], 0=<<BracketGroupId:BracketGroup:32>>}
> 2009-01-30 11:28:42,483 [btpool0-2] ERROR
> com.protrade.bracket.fbsite.filters.AppSubscriptionHandler - The specified
> parameter of type "class com.protrade.bracket.data.entities.User" is not a
> valid query parameter.
> <openjpa-2.0.0-SNAPSHOT-r422266:739178 nonfatal user error>
> org.apache.openjpa.persistence.ArgumentException: The specified parameter of
> type "class com.protrade.bracket.data.entities.User" is not a valid query
> parameter.
> at
> org.apache.openjpa.jdbc.sql.DBDictionary.setUnknown(DBDictionary.java:1354)
> at
> org.apache.openjpa.jdbc.kernel.SQLStoreQuery$SQLExecutor.executeQuery(SQLStoreQuery.java:314)
> at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:997)
> at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:846)
> at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:777)
> at
> org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:525)
> at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:274)
> at
> org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:284)
> at com.protrade.common.persistence.JPAUtil.execute(JPAUtil.java:195)
> at com.protrade.common.persistence.JPAUtil.execute(JPAUtil.java:170)
> at com.protrade.common.persistence.JPAUtil.executeList(JPAUtil.java:155)
> at com.protrade.common.persistence.JPADQuery.list(JPADQuery.java:24)
> at
> com.protrade.common.persistence.BaseRootDAOBase.runListQueryWithListNCS(BaseRootDAOBase.java:272)
> at
> com.protrade.common.persistence.BaseRootDAOBase.findByFieldsNCS(BaseRootDAOBase.java:199)
> at
> com.protrade.common.persistence.BaseRootDAOBase.existsByFieldsNCS(BaseRootDAOBase.java:236)
> at
> com.protrade.common.persistence.BaseDAOBase.existsByFieldsNCS(BaseDAOBase.java:144)
> at com.protrade.bracket.data.BracketDao.isBracketeer(BracketDao.java:152)
> @Entity
> public class Bracketeer extends HBaseIdCreateTime implements IBracketeer {
> ...
> @Persistent
> @Externalizer( "getIdLong" )
> private BracketGroupId group;
> @ManyToOne
> @JoinColumn( name = "USER_JDOID" )
> private User user;
> ...
> }
> @Entity
> public class User extends HBaseIdCreateTime implements UnifiedSocialUser {
> ...
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.