Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Insert into table using ReadallQuery with expression

EclipseLink (and JPA) does not support this, please log an enhancement
request for this (insert all query), it would be similar to the update-all
and delete-all support.

you can either use a native SQL query, or read in the objects and write them
back out using a different class, or different persistence unit/session
mapped to the other table.



tch wrote:
> 
> This has got to be a common use case, I'm just not seeing how to do
> this with the API.
> 
> I want to take an expression off of a ReadAllQuery, change the select
> values (I'd assume I'd have to use a Report Query)? and insert that
> into a new table.
> 
> Example:
> 
> insert into employee_tracking
> select 1,'custom_string',e.name from employee
> where employee....
> 
> 
> So I already have a nice ReadAllQuery representing the select from
> employee, I want to reuse that to do a bulk insert into
> employee_tracking. It's a basic bulk action from a search type
> pattern.
> 
> Ideas?
> 
> Thanks!
> 
> ./tch
> 
> 


-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
Blog:  http://java-persistence-performance.blogspot.com/ Java Persistence
Performance 
-- 
View this message in context: http://old.nabble.com/Insert-into-table-using-ReadallQuery-with-expression-tp31279500p31335597.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top