Uploaded image for project: 'Torque'
  1. Torque
  2. TORQUE-28

Generator doesn't generate correctly BaseXXXPeer.java files if property torque.subpackage.object is specified

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.2
    • 3.3
    • Generator
    • None
    • All environments

    Description

      It seems torque generator incorrectly generates BaseXXXPeer
      java sources if property torque.subpackage.object is specified.

      Bug can be reproduced this way

      1. set property torque.subpackage.object (for example
      torque.subpackage.object = object)
      2. execute maven torque:om goal
      3. examine generated BaseXXXPeer.java files. Look for lines

      /** A class that can be returned by this peer. */
      protected static final String CLASSNAME_DEFAULT =
      "${package}.${table}";

      (instead of velocity variables package and table you'll see substituted
      values, of course)

      Correct lines should looks like

      /** A class that can be returned by this peer. */
      protected static final String CLASSNAME_DEFAULT =
      "${packageObject}.${table}";

      Bug is in Torque templates module, in file
      templates/src/templates/om/Peer.vm

      Here is patch

      Best regards

      Mojmir Hanes

      Index: E:/Projekty/3rd-parties/Torque/templates/src/templates/om/Peer.vm
      ===================================================================
      — E:/Projekty/3rd-parties/Torque/templates/src/templates/om/Peer.vm (revision 413121)
      +++ E:/Projekty/3rd-parties/Torque/templates/src/templates/om/Peer.vm (working copy)
      @@ -125,7 +125,7 @@

      /** A class that can be returned by this peer. */
      protected static final String CLASSNAME_DEFAULT =

      • "${package}.$table.JavaName";
        + "${packageObject}.$table.JavaName";

      /** A class that can be returned by this peer. */
      protected static final Class CLASS_DEFAULT = initClass(CLASSNAME_DEFAULT);

      Attachments

        Issue Links

          Activity

            People

              tfischer Thomas Fox
              miuek Mojmir Hanes
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: