> On Sep 11, 2015, at 6:32 PM, Dipesh Jain <dip...@ivgroup.in> wrote:
> 
> I am using apache cayenne 3.1. I know of one way to update records in the
> database is to first use select query to find record and then update it,
> but I don't want to use a select query for updating. How can I directly
> update the record? I do not want to use EJBQLQuery or SQL TEMPLETE.
> 
> -- 
> Thanks and Regards
> Deepesh Jain

Hi Deepesh, 

My #1 solution won't be EJBQLQuery or SQLTemplate either. I would actually 
select the objects that I need, change them and commit. This is a true ORM 
solution, as you are working with objects, can apply business logic, listeners 
and what not. 

In more rare cases of "bulk update", when a single query updates a bunch of 
records without bothering to fault objects, EJBQLQuery or SQLTemplate is the 
way to do it. 

So what case are you dealing with?

Andrus

Reply via email to