FAQ
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 ?

Search Discussions

  • Robert Zeigler at Nov 2, 2011 at 9:03 pm
    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 ?
  • Michael Gentry at Nov 2, 2011 at 11:56 pm
    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
    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 ?

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriescayenne
postedNov 2, '11 at 8:58p
activeNov 2, '11 at 11:56p
posts3
users3
websitecayenne.apache.org

People

Translate

site design / logo © 2021 Grokbase