You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@metamodel.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2015/12/09 16:11:10 UTC

[jira] [Commented] (METAMODEL-6) Get back update status after invoking executeUpdate(...)

    [ https://issues.apache.org/jira/browse/METAMODEL-6?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15048792#comment-15048792 ] 

ASF GitHub Bot commented on METAMODEL-6:
----------------------------------------

GitHub user kaspersorensen opened a pull request:

    https://github.com/apache/metamodel/pull/77

    First attempts at making the API change for METAMODEL-6

    This PR proposes an important API change (admittedly without any proper implementation at this stage) to allow the publishing of information about a given data change/update.
    
    I decided to post this PR without any proper implementation because (1) the API change alone will be beneficial to do sooner rather than later - we seem to be approaching a 4.5.0 release at the moment, so I find it smarter to break the API now instead of having to wait for the next major release and (2) adding the better implementation of the update summary can always be done on a case-by-case basis. I would suggest to start with a generic method for the number of inserts since that can be generalized very easily.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/kaspersorensen/metamodel METAMODEL-6/execute-update-return-value

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/metamodel/pull/77.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #77
    
----
commit a15ca724b5c4556ebb65700b4d50db878b6b159c
Author: Kasper Sørensen <i....@gmail.com>
Date:   2015-12-09T12:14:07Z

    First attempts at making the API change for METAMODEL-6

----


> Get back update status after invoking executeUpdate(...)
> --------------------------------------------------------
>
>                 Key: METAMODEL-6
>                 URL: https://issues.apache.org/jira/browse/METAMODEL-6
>             Project: Apache MetaModel
>          Issue Type: Wish
>            Reporter: Kasper Sørensen
>            Assignee: Kasper Sørensen
>            Priority: Minor
>
> In the current API design of MetaModel, the DataContext.executeUpdate(...) method is a void method. This was initially chosen because not all implementations have the capability to report anything about a particular update. But some do, for instance the no. of inserted, updated or deleted records from a JDBC call. It would be nice to expose this information when available.
> My suggestion for this would be to let the DataContext.executeUpdate(...) method return an object with this information. All methods on the new object type would be optionally returning null, if no information is available. But when available, we can at least expose it this way.
> The change wouldn't have a major impact, since any project using MetaModel would already need to recompile because of the namespace change to org.apache.metamodel. And the change would be compile-time compatible with having a void return type.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)