[ https://issues.apache.org/jira/browse/JDO-617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14623750#comment-14623750 ]
Tilmann Zäschke commented on JDO-617: ------------------------------------- I agree with Craig and Andy. I would even go further and say that having read-only queries is an advantage of JDO and OO databases because it allows for a certain level of encapsulation (with respect to write access). While encapsulation is generally useful, I think it is especially useful during database evolution, because encapsulation means that any 'write' or 'update' code is local to a class and it is much less likely that any such update-code is forgotten when the application undergoes a change of the data model. This can help preventing problems when forgotten (unevolved) queries write to the database. Such problems include obviously an error during query execution, but more importantly it may help preventing problems when the schema is still compatible, but the semantics of the database have changed and the database may become inconsistent. This simplified evolution and protection from 'old' queries can make a difference in agile iterative projects with lots of schema/data evolution. I do however support the idea of executing Java code on the server, possibly also by means of Java 8 lambdas, once we get to Java 8. > JDOQL : Bulk Update and Delete Operations > ----------------------------------------- > > Key: JDO-617 > URL: https://issues.apache.org/jira/browse/JDO-617 > Project: JDO > Issue Type: New Feature > Reporter: Eric SULTAN > > It would be usefull that the JDO Query Langage could do some UPDATE and > DELETE on Persistent Object like this : > UPDATE [<candidate-class>] SET item1=<newValue>, item2=<newValue> [WHERE > <filter>] > The new_value specified for an update operation must be compatible in type > with the state-field to > which it is assigned. > Bulk Update must modify the value of the version column and refresh Level1 > and Level2 cache. > DELETE FROM [<candidate-class>] [WHERE <filter>] > By default Bulk Delete is appy on the specified class and its subclasses and > doesn't do cascade delete. > A keyword like CASCADE must be set if we want to does a cascade delete : > DELETE CASCADE FROM [<candidate-class>] [WHERE <filter>] -- This message was sent by Atlassian JIRA (v6.3.4#6332)