You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by stéphane Lestoclet <st...@yahoo.fr> on 2011/11/02 21:58:01 UTC

persistent entities names

hi,

for every persistent entity, there is a class automatically generated (its name starts with underscore "_"),
in those classes, we define property names as static final strings but they are never used by the methods :
readProperty and writeProperty..
why ?

Re: persistent entities names

Posted by Michael Gentry <mg...@masslight.net>.
I've been meaning to fix that in the template for ages now, but keep
forgetting.  There isn't any hidden reason for not using the
constants, I just haven't updated the template to use them.

mrg

On Wed, Nov 2, 2011 at 4:58 PM, stéphane Lestoclet
<st...@yahoo.fr> wrote:
> hi,
>
> for every persistent entity, there is a class automatically generated (its name starts with underscore "_"),
> in those classes, we define property names as static final strings but they are never used by the methods :
> readProperty and writeProperty..
> why ?
>

Re: persistent entities names

Posted by Robert Zeigler <ro...@roxanemy.com>.
Primarily because the static final strings are assigned to a $propertyName variable value in the template... and so are the strings in readProperty and writeProperty.  Since it's an auto-generated class, there isn't much point to using the static string declarations in the read/write properties. The static variables are there as a convenience to user-code, so you don't have to hard-code the property names (and you get to utilize code completion in your IDE), a convenience that I greatly miss when using hibernate. :)


Robert

On Nov 2, 2011, at 11/23:58 PM , stéphane Lestoclet wrote:

> hi,
> 
> for every persistent entity, there is a class automatically generated (its name starts with underscore "_"),
> in those classes, we define property names as static final strings but they are never used by the methods :
> readProperty and writeProperty..
> why ?