FAQ
Hi all.
Can I generate my DataObject classes without a “get”-prefix for attribute accessor names? I much prefer the style of “name()” over “getName()”.

Cheers,
- hugi

PS: Sorry for my flooding of the list. Catching up on previous work on migration from EOF— I must say 4.0.M2 looks just awesome.

Search Discussions

  • Michael Gentry at Apr 1, 2015 at 12:50 pm
    Hi Hugi,

    You can roll your own templates (I've done this in the past) and change the
    names if you like, but keep in mind it may complicate your life if you use
    other projects (such as Tapestry) which rely upon the Java Beans convention
    (get*, set*, is*) when doing reflection to call the Cayenne methods.

    If you want to roll your own templates, I can point you to an example.

    mrg

    On Wed, Apr 1, 2015 at 6:44 AM, Hugi Thordarson wrote:

    Hi all.
    Can I generate my DataObject classes without a “get”-prefix for attribute
    accessor names? I much prefer the style of “name()” over “getName()”.

    Cheers,
    - hugi

    PS: Sorry for my flooding of the list. Catching up on previous work on
    migration from EOF— I must say 4.0.M2 looks just awesome.
  • Hugi Thordarson at Apr 1, 2015 at 1:02 pm
    Hi Michael.
    Thanks for the pointer, I’d love an example of rolling my own templates. Are the standard default templates accessible somewhere?

    Also, is class file generation accessible via an API or otherwise supported outside of the Modeler? One convenient feature of WOLips (when using EOF) is autogeneration of classes every time the model changes. If this doesn’t currently exist in Cayenne I’d like to implement it.

    Cheers,
    - hugi

    // Hugi Thordarson
    // http://www.loftfar.is/ <http://www.loftfar.is/>
    // s. 895-6688


    On 1. apr. 2015, at 12:47, Michael Gentry wrote:

    Hi Hugi,

    You can roll your own templates (I've done this in the past) and change the
    names if you like, but keep in mind it may complicate your life if you use
    other projects (such as Tapestry) which rely upon the Java Beans convention
    (get*, set*, is*) when doing reflection to call the Cayenne methods.

    If you want to roll your own templates, I can point you to an example.

    mrg

    On Wed, Apr 1, 2015 at 6:44 AM, Hugi Thordarson wrote:

    Hi all.
    Can I generate my DataObject classes without a “get”-prefix for attribute
    accessor names? I much prefer the style of “name()” over “getName()”.

    Cheers,
    - hugi

    PS: Sorry for my flooding of the list. Catching up on previous work on
    migration from EOF— I must say 4.0.M2 looks just awesome.
  • Andrus Adamchik at Apr 1, 2015 at 1:10 pm

    On Apr 1, 2015, at 3:57 PM, Hugi Thordarson wrote:

    Also, is class file generation accessible via an API or otherwise supported outside of the Modeler?
    I use Maven and cgen (same works with Ant):

    http://cayenne.apache.org/docs/4.0/cayenne-guide/including-cayenne-in-project.html#maven-projects

    so the classes are re-synced with the model on every build.
    One convenient feature of WOLips (when using EOF) is autogeneration of classes every time the model changes. If this doesn’t currently exist in Cayenne I’d like to implement it.
    Older versions of Eclipse were even able to run maven cgen task on project refresh. Haven't checked with the latest ones. Worst case, you'd run Maven manually from command line.

    Andrus
  • Michael Gentry at Apr 1, 2015 at 1:19 pm
    This works with 3.0.2. I need to upgrade it for 3.1, but hopefully it'll
    give you the general idea:

    https://github.com/mrg/cbe/tree/master/Templates

    http://mrg.github.io/cbe/custom-templates.html

    mrg

    On Wed, Apr 1, 2015 at 8:57 AM, Hugi Thordarson wrote:

    Hi Michael.
    Thanks for the pointer, I’d love an example of rolling my own templates.
    Are the standard default templates accessible somewhere?

    Also, is class file generation accessible via an API or otherwise
    supported outside of the Modeler? One convenient feature of WOLips (when
    using EOF) is autogeneration of classes every time the model changes. If
    this doesn’t currently exist in Cayenne I’d like to implement it.

    Cheers,
    - hugi

    // Hugi Thordarson
    // http://www.loftfar.is/ <http://www.loftfar.is/>
    // s. 895-6688


    On 1. apr. 2015, at 12:47, Michael Gentry wrote:

    Hi Hugi,

    You can roll your own templates (I've done this in the past) and change the
    names if you like, but keep in mind it may complicate your life if you use
    other projects (such as Tapestry) which rely upon the Java Beans
    convention
    (get*, set*, is*) when doing reflection to call the Cayenne methods.

    If you want to roll your own templates, I can point you to an example.

    mrg

    On Wed, Apr 1, 2015 at 6:44 AM, Hugi Thordarson wrote:

    Hi all.
    Can I generate my DataObject classes without a “get”-prefix for
    attribute
    accessor names? I much prefer the style of “name()” over “getName()”.

    Cheers,
    - hugi

    PS: Sorry for my flooding of the list. Catching up on previous work on
    migration from EOF— I must say 4.0.M2 looks just awesome.
  • John Huss at Apr 1, 2015 at 2:05 pm
    There are WO friendly templates for Cayenne in the ERCayenne framework in
    Project Wonder that you can copy.
    On Wed, Apr 1, 2015 at 7:18 AM Michael Gentry wrote:

    This works with 3.0.2. I need to upgrade it for 3.1, but hopefully it'll
    give you the general idea:

    https://github.com/mrg/cbe/tree/master/Templates

    http://mrg.github.io/cbe/custom-templates.html

    mrg

    On Wed, Apr 1, 2015 at 8:57 AM, Hugi Thordarson wrote:

    Hi Michael.
    Thanks for the pointer, I’d love an example of rolling my own templates.
    Are the standard default templates accessible somewhere?

    Also, is class file generation accessible via an API or otherwise
    supported outside of the Modeler? One convenient feature of WOLips (when
    using EOF) is autogeneration of classes every time the model changes. If
    this doesn’t currently exist in Cayenne I’d like to implement it.

    Cheers,
    - hugi

    // Hugi Thordarson
    // http://www.loftfar.is/ <http://www.loftfar.is/>
    // s. 895-6688


    On 1. apr. 2015, at 12:47, Michael Gentry wrote:

    Hi Hugi,

    You can roll your own templates (I've done this in the past) and change the
    names if you like, but keep in mind it may complicate your life if you use
    other projects (such as Tapestry) which rely upon the Java Beans
    convention
    (get*, set*, is*) when doing reflection to call the Cayenne methods.

    If you want to roll your own templates, I can point you to an example.

    mrg


    On Wed, Apr 1, 2015 at 6:44 AM, Hugi Thordarson <hugi@karlmenn.is>
    wrote:
    Hi all.
    Can I generate my DataObject classes without a “get”-prefix for
    attribute
    accessor names? I much prefer the style of “name()” over “getName()”.

    Cheers,
    - hugi

    PS: Sorry for my flooding of the list. Catching up on previous work on
    migration from EOF— I must say 4.0.M2 looks just awesome.
  • Hugi Thordarson at Apr 1, 2015 at 2:46 pm
    Ah, excellent! Where inside ERCayenne are they though, can’t find them at a quick glance.

    - hugi

    // Hugi Thordarson
    // http://www.loftfar.is/ <http://www.loftfar.is/>
    // s. 895-6688


    On 1. apr. 2015, at 14:03, John Huss wrote:

    There are WO friendly templates for Cayenne in the ERCayenne framework in
    Project Wonder that you can copy.
    On Wed, Apr 1, 2015 at 7:18 AM Michael Gentry wrote:

    This works with 3.0.2. I need to upgrade it for 3.1, but hopefully it'll
    give you the general idea:

    https://github.com/mrg/cbe/tree/master/Templates

    http://mrg.github.io/cbe/custom-templates.html

    mrg

    On Wed, Apr 1, 2015 at 8:57 AM, Hugi Thordarson wrote:

    Hi Michael.
    Thanks for the pointer, I’d love an example of rolling my own templates.
    Are the standard default templates accessible somewhere?

    Also, is class file generation accessible via an API or otherwise
    supported outside of the Modeler? One convenient feature of WOLips (when
    using EOF) is autogeneration of classes every time the model changes. If
    this doesn’t currently exist in Cayenne I’d like to implement it.

    Cheers,
    - hugi

    // Hugi Thordarson
    // http://www.loftfar.is/ <http://www.loftfar.is/>
    // s. 895-6688


    On 1. apr. 2015, at 12:47, Michael Gentry <mgentry@masslight.net>
    wrote:
    Hi Hugi,

    You can roll your own templates (I've done this in the past) and change the
    names if you like, but keep in mind it may complicate your life if you use
    other projects (such as Tapestry) which rely upon the Java Beans
    convention
    (get*, set*, is*) when doing reflection to call the Cayenne methods.

    If you want to roll your own templates, I can point you to an example.

    mrg


    On Wed, Apr 1, 2015 at 6:44 AM, Hugi Thordarson <hugi@karlmenn.is>
    wrote:
    Hi all.
    Can I generate my DataObject classes without a “get”-prefix for
    attribute
    accessor names? I much prefer the style of “name()” over “getName()”.

    Cheers,
    - hugi

    PS: Sorry for my flooding of the list. Catching up on previous work on
    migration from EOF— I must say 4.0.M2 looks just awesome.
  • John Huss at Apr 1, 2015 at 2:53 pm
    It's in the example project ERCayenneExample
    On Wed, Apr 1, 2015 at 8:46 AM Hugi Thordarson wrote:

    Ah, excellent! Where inside ERCayenne are they though, can’t find them at
    a quick glance.

    - hugi

    // Hugi Thordarson
    // http://www.loftfar.is/ <http://www.loftfar.is/>
    // s. 895-6688


    On 1. apr. 2015, at 14:03, John Huss wrote:

    There are WO friendly templates for Cayenne in the ERCayenne framework in
    Project Wonder that you can copy.
    On Wed, Apr 1, 2015 at 7:18 AM Michael Gentry wrote:

    This works with 3.0.2. I need to upgrade it for 3.1, but hopefully
    it'll
    give you the general idea:

    https://github.com/mrg/cbe/tree/master/Templates

    http://mrg.github.io/cbe/custom-templates.html

    mrg

    On Wed, Apr 1, 2015 at 8:57 AM, Hugi Thordarson wrote:

    Hi Michael.
    Thanks for the pointer, I’d love an example of rolling my own
    templates.
    Are the standard default templates accessible somewhere?

    Also, is class file generation accessible via an API or otherwise
    supported outside of the Modeler? One convenient feature of WOLips
    (when
    using EOF) is autogeneration of classes every time the model changes.
    If
    this doesn’t currently exist in Cayenne I’d like to implement it.

    Cheers,
    - hugi

    // Hugi Thordarson
    // http://www.loftfar.is/ <http://www.loftfar.is/>
    // s. 895-6688


    On 1. apr. 2015, at 12:47, Michael Gentry <mgentry@masslight.net>
    wrote:
    Hi Hugi,

    You can roll your own templates (I've done this in the past) and
    change
    the
    names if you like, but keep in mind it may complicate your life if you use
    other projects (such as Tapestry) which rely upon the Java Beans
    convention
    (get*, set*, is*) when doing reflection to call the Cayenne methods.

    If you want to roll your own templates, I can point you to an example.

    mrg


    On Wed, Apr 1, 2015 at 6:44 AM, Hugi Thordarson <hugi@karlmenn.is>
    wrote:
    Hi all.
    Can I generate my DataObject classes without a “get”-prefix for
    attribute
    accessor names? I much prefer the style of “name()” over “getName()”.

    Cheers,
    - hugi

    PS: Sorry for my flooding of the list. Catching up on previous work
    on
    migration from EOF— I must say 4.0.M2 looks just awesome.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriescayenne
postedApr 1, '15 at 10:47a
activeApr 1, '15 at 2:53p
posts8
users4
websitecayenne.apache.org

People

Translate

site design / logo © 2022 Grokbase