You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ddlutils-dev@db.apache.org by "Lucas Moreno (JIRA)" <ji...@apache.org> on 2007/03/12 17:05:09 UTC

[jira] Created: (DDLUTILS-163) Platform Update Behavor should not set to NULL not defined properties of a DynaBean

Platform Update Behavor should not set to NULL  not defined properties of a DynaBean
------------------------------------------------------------------------------------

                 Key: DDLUTILS-163
                 URL: https://issues.apache.org/jira/browse/DDLUTILS-163
             Project: DdlUtils
          Issue Type: Improvement
          Components: Core (No specific database)
         Environment: All environements
            Reporter: Lucas Moreno
         Assigned To: Thomas Dudziak


The default update behavor implemented in PlatformImpl takes a DynaBean as parameter and creates a UPDATE statement for all the columns of the table nor only those ones defined as properties of the bean.

The result is that not specified properties of the bean are set to NULL which may no be the desired behavor.

An update using a DynaBean should only update columns wich have a value (also null)  for a given property.

As I see, the update method should:

 - Check that all the primary keys are defined in the bean
 - Prepare a SQL Update query only with the values specified in the  bean
 - Execute the update


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DDLUTILS-163) Platform Update Behavor should not set to NULL not defined properties of a DynaBean

Posted by "Thomas Dudziak (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DDLUTILS-163?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Dudziak updated DDLUTILS-163:
------------------------------------

    Fix Version/s: 1.2

> Platform Update Behavor should not set to NULL  not defined properties of a DynaBean
> ------------------------------------------------------------------------------------
>
>                 Key: DDLUTILS-163
>                 URL: https://issues.apache.org/jira/browse/DDLUTILS-163
>             Project: DdlUtils
>          Issue Type: Improvement
>          Components: Core (No specific database)
>         Environment: All environements
>            Reporter: Lucas Moreno
>            Assignee: Thomas Dudziak
>             Fix For: 1.2
>
>
> The default update behavor implemented in PlatformImpl takes a DynaBean as parameter and creates a UPDATE statement for all the columns of the table nor only those ones defined as properties of the bean.
> The result is that not specified properties of the bean are set to NULL which may no be the desired behavor.
> An update using a DynaBean should only update columns wich have a value (also null)  for a given property.
> As I see, the update method should:
>  - Check that all the primary keys are defined in the bean
>  - Prepare a SQL Update query only with the values specified in the  bean
>  - Execute the update

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DDLUTILS-163) Platform Update Behavor should not set to NULL not defined properties of a DynaBean

Posted by "Lucas Moreno (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DDLUTILS-163?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12481080 ] 

Lucas Moreno commented on DDLUTILS-163:
---------------------------------------

I don't understand what do you want to say by this. 
Looking the code, the update method in PlateformImpl:

* We retreave the primary keys of the DynaClass
* We retreave the non primary keys of the dynaClass

And using it we prepare the SQL statement (using ? ). 
When creating the update string, we could verify that the non primary keys are defined in the bean, otherwise the update method do not include the column with the ? 

Non?

> Platform Update Behavor should not set to NULL  not defined properties of a DynaBean
> ------------------------------------------------------------------------------------
>
>                 Key: DDLUTILS-163
>                 URL: https://issues.apache.org/jira/browse/DDLUTILS-163
>             Project: DdlUtils
>          Issue Type: Improvement
>          Components: Core (No specific database)
>         Environment: All environements
>            Reporter: Lucas Moreno
>         Assigned To: Thomas Dudziak
>
> The default update behavor implemented in PlatformImpl takes a DynaBean as parameter and creates a UPDATE statement for all the columns of the table nor only those ones defined as properties of the bean.
> The result is that not specified properties of the bean are set to NULL which may no be the desired behavor.
> An update using a DynaBean should only update columns wich have a value (also null)  for a given property.
> As I see, the update method should:
>  - Check that all the primary keys are defined in the bean
>  - Prepare a SQL Update query only with the values specified in the  bean
>  - Execute the update

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DDLUTILS-163) Platform Update Behavor should not set to NULL not defined properties of a DynaBean

Posted by "Thomas Dudziak (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DDLUTILS-163?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12481199 ] 

Thomas Dudziak commented on DDLUTILS-163:
-----------------------------------------

The problem is that in the extreme case (which properties are undefined varies from dyna bean to dyna bean) for each bean a new prepared statement has to be created which in turn renders batch mode useless and means a huge performance impact. 

> Platform Update Behavor should not set to NULL  not defined properties of a DynaBean
> ------------------------------------------------------------------------------------
>
>                 Key: DDLUTILS-163
>                 URL: https://issues.apache.org/jira/browse/DDLUTILS-163
>             Project: DdlUtils
>          Issue Type: Improvement
>          Components: Core (No specific database)
>         Environment: All environements
>            Reporter: Lucas Moreno
>         Assigned To: Thomas Dudziak
>
> The default update behavor implemented in PlatformImpl takes a DynaBean as parameter and creates a UPDATE statement for all the columns of the table nor only those ones defined as properties of the bean.
> The result is that not specified properties of the bean are set to NULL which may no be the desired behavor.
> An update using a DynaBean should only update columns wich have a value (also null)  for a given property.
> As I see, the update method should:
>  - Check that all the primary keys are defined in the bean
>  - Prepare a SQL Update query only with the values specified in the  bean
>  - Execute the update

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DDLUTILS-163) Platform Update Behavor should not set to NULL not defined properties of a DynaBean

Posted by "Thomas Dudziak (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DDLUTILS-163?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12480837 ] 

Thomas Dudziak commented on DDLUTILS-163:
-----------------------------------------

The one problem with this is that it prevents the use of batch mode because the SQL possibly/likely changes from bean to bean, so inserts will be slower (way slower for a large number of beans).

> Platform Update Behavor should not set to NULL  not defined properties of a DynaBean
> ------------------------------------------------------------------------------------
>
>                 Key: DDLUTILS-163
>                 URL: https://issues.apache.org/jira/browse/DDLUTILS-163
>             Project: DdlUtils
>          Issue Type: Improvement
>          Components: Core (No specific database)
>         Environment: All environements
>            Reporter: Lucas Moreno
>         Assigned To: Thomas Dudziak
>
> The default update behavor implemented in PlatformImpl takes a DynaBean as parameter and creates a UPDATE statement for all the columns of the table nor only those ones defined as properties of the bean.
> The result is that not specified properties of the bean are set to NULL which may no be the desired behavor.
> An update using a DynaBean should only update columns wich have a value (also null)  for a given property.
> As I see, the update method should:
>  - Check that all the primary keys are defined in the bean
>  - Prepare a SQL Update query only with the values specified in the  bean
>  - Execute the update

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.