openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Milosz Tylenda (JIRA)" <j...@apache.org>
Subject [jira] Commented: (OPENJPA-920) LIKE does not accept expression as second parameter
Date Sun, 15 Feb 2009 18:32:59 GMT

    [ https://issues.apache.org/jira/browse/OPENJPA-920?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12673687#action_12673687
] 

Milosz Tylenda commented on OPENJPA-920:
----------------------------------------

You can make this bug invalid or, if you think this lacking functionality is important, you
can change the issue type from Bug to Wish, for example.


> LIKE does not accept expression as second parameter
> ---------------------------------------------------
>
>                 Key: OPENJPA-920
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-920
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 1.2.0
>         Environment: JDK 1.6
>            Reporter: Georgi Naplatanov
>
> I have simple data object :
> 	@Id
> 	String Id ;
> 	
> 	@Basic
> 	@Column(name="my_value", nullable=false, length=36)
> 	String value  ;
> OpenJPA give my the following exception when execute the query:
> SELECT t from MySimpleObject t WHERE ?1 like concat(t.value,'%')
> Exception in thread "main" <openjpa-1.2.0-rexported nonfatal user error> org.apache.openjpa.persistence.ArgumentException:
Encountered "? 1 like concat" at character 38, but expected: ["(", "*", "+", "-", "/", ":",
"<", "<=", "<>", "=", ">", ">=", "?", "BETWEEN", "CURRENT_DATE", "CURRENT_TIME",
"CURRENT_TIMESTAMP", "EXISTS", "IS", "LIKE", "MEMBER", "NOT", <BOOLEAN_LITERAL>, <DECIMAL_LITERAL>,
<IDENTIFIER>, <INTEGER_LITERAL>, <STRING_LITERAL>].
> 	at org.apache.openjpa.kernel.jpql.JPQL.generateParseException(JPQL.java:9501)
> 	at org.apache.openjpa.kernel.jpql.JPQL.jj_consume_token(JPQL.java:9378)
> 	at org.apache.openjpa.kernel.jpql.JPQL.conditional_primary(JPQL.java:1947)
> 	at org.apache.openjpa.kernel.jpql.JPQL.conditional_factor(JPQL.java:1925)
> 	at org.apache.openjpa.kernel.jpql.JPQL.conditional_term(JPQL.java:1791)
> 	at org.apache.openjpa.kernel.jpql.JPQL.conditional_expression(JPQL.java:1753)
> 	at org.apache.openjpa.kernel.jpql.JPQL.where_clause(JPQL.java:1556)
> 	at org.apache.openjpa.kernel.jpql.JPQL.select_statement(JPQL.java:91)
> 	at org.apache.openjpa.kernel.jpql.JPQL.parseQuery(JPQL.java:63)
> 	at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.parse(JPQLExpressionBuilder.java:1740)
> 	at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.<init>(JPQLExpressionBuilder.java:1727)
> 	at org.apache.openjpa.kernel.jpql.JPQLParser.parse(JPQLParser.java:48)
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery.newCompilation(ExpressionStoreQuery.java:149)
> 	at org.apache.openjpa.datacache.QueryCacheStoreQuery.newCompilation(QueryCacheStoreQuery.java:241)
> 	at org.apache.openjpa.kernel.QueryImpl.newCompilation(QueryImpl.java:657)
> 	at org.apache.openjpa.kernel.QueryImpl.compilationFromCache(QueryImpl.java:639)
> 	at org.apache.openjpa.kernel.QueryImpl.compileForCompilation(QueryImpl.java:605)
> 	at org.apache.openjpa.kernel.QueryImpl.compileForExecutor(QueryImpl.java:667)
> 	at org.apache.openjpa.kernel.QueryImpl.getOperation(QueryImpl.java:1492)
> 	at org.apache.openjpa.kernel.DelegatingQuery.getOperation(DelegatingQuery.java:123)
> 	at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:243)
> 	at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:293)
> 	at Tester.simpleJpql(Tester.java:87)
> 	at Tester.main(Tester.java:180)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message