cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <>
Subject Re: How do you update a record with apache cayenne without using select clause
Date Fri, 11 Sep 2015 16:44:21 GMT

> On Sep 11, 2015, at 6:32 PM, Dipesh Jain <> 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?

View raw message