Is there any way to perform bulk insert into a DB table using Apache Cayenne. There are some scenarios for me where I need to perform bulk insert. I am not sure how can we do this in Cayenne.
Any help in this regard is really appreciated.
Is there any way to perform bulk insert into a DB table using Apache Cayenne. There are some scenarios for me where I need to perform bulk insert. I am not sure how can we do this in Cayenne.
Any help in this regard is really appreciated.
There are two ways - EJBQLQuery and SQLTemplate. EJBQLQuery can be used if you can express your query in therms of the object model. E.g.:
UPDATE Publisher pub SET pub.status = 'outstanding' WHERE pub.revenue < 1000000
Otherwise use SQLTemplate. It even allows batching of multiple parameter sets (see 'setParameters').