[ 
https://issues.apache.org/jira/browse/OPENJPA-101?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Richard Zowalla resolved OPENJPA-101.
-------------------------------------
    Resolution: Fixed

Already fixed on master: JPQL.jjt:691-699 constructor_parameter accepts 
scalar_expression, which includes string_literal, numeric_literal and 
input_parameter (string_primary at 1251, arithmetic_factor at 1071, 
arithmetic_primary at 1080). Closing; please reopen if this still happens with 
OpenJPA 4.x.

> enhance JPQL Constructor Expressions implementation
> ---------------------------------------------------
>
>                 Key: OPENJPA-101
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-101
>             Project: OpenJPA
>          Issue Type: Improvement
>          Components: query
>            Reporter: wanyna
>            Priority: Major
>
> There are two tables A and B, I need to execute sql like
> "insert into A select ... from B".
> I use JPQL Constructor Expressions,
> select new A(...) from B, got A list then persist.
> But some fields of A depends on program context, not direct from B, so SELECT 
> NEW clause should look like these :
> select new A(B.column1, 'xxx') from B, or
> select new A(null, B.column2) from B, or
> select new A(variable, B.column2) from B.
> Unfortunately, OpenJPA doesn't support this.
> I have to get the result object[] list and constuct A in my code now. 
> If JPQL Constructor Expressions become more powerful, my code  will be more 
> simple then. 



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to