You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Bharat Kumar <bh...@citrix.com> on 2013/07/29 12:47:51 UTC

Regarding the variable names in the VOs.

Hi all, 

I am came across a bug which was caused because of using underscore in the variable name in the VO. 

 @Column(name = "concurrent_connections")
    Integer concurrent_connections;

because of this the call to update dose not update the VO and if the API is used only with this parameter the API server throws an error.

but if i change it to 


    @Column(name = "concurrent_connections")
    Integer concurrentConnections;

(remove the underscore)  it works. 

Dose any one know why this dependency is there. 

Regards,
Bharat.


Re: Regarding the variable names in the VOs.

Posted by Wei ZHOU <us...@gmail.com>.
AFAIK, The @Colume should be same to the column in database.
The variable concurrentConnections/concurrent_connections should be same to
the responding *DaoImpl.java


2013/7/29 Bharat Kumar <bh...@citrix.com>

> Hi all,
>
> I am came across a bug which was caused because of using underscore in the
> variable name in the VO.
>
>  @Column(name = "concurrent_connections")
>     Integer concurrent_connections;
>
> because of this the call to update dose not update the VO and if the API
> is used only with this parameter the API server throws an error.
>
> but if i change it to
>
>
>     @Column(name = "concurrent_connections")
>     Integer concurrentConnections;
>
> (remove the underscore)  it works.
>
> Dose any one know why this dependency is there.
>
> Regards,
> Bharat.
>
>

Re: Regarding the variable names in the VOs.

Posted by Min Chen <mi...@citrix.com>.
You can read Alex's tutorial regarding this:
https://cwiki.apache.org/confluence/display/CLOUDSTACK/Data+Access+Layer
VO fieldname and its getter/setter method have to follow java convention.

Thanks
-min



On 7/29/13 3:47 AM, "Bharat Kumar" <bh...@citrix.com> wrote:

>Hi all, 
>
>I am came across a bug which was caused because of using underscore in
>the variable name in the VO.
>
> @Column(name = "concurrent_connections")
>    Integer concurrent_connections;
>
>because of this the call to update dose not update the VO and if the API
>is used only with this parameter the API server throws an error.
>
>but if i change it to
>
>
>    @Column(name = "concurrent_connections")
>    Integer concurrentConnections;
>
>(remove the underscore)  it works.
>
>Dose any one know why this dependency is there.
>
>Regards,
>Bharat.
>