FAQ
cgen ant task generates nonsense if superpkg attribute is missing, should fail instead
--------------------------------------------------------------------------------------

Key: CAY-958
URL: https://issues.apache.org/cayenne/browse/CAY-958
Project: Cayenne
Issue Type: Bug
Affects Versions: 3.0
Environment: should not matter, but XP SP2 with all latest, sun java 1.6.0_03
Reporter: Michael Bergens
Assignee: Andrus Adamchik


with the 3.0M2 Cayenne distro, this ant task:

<cgen map="${db.map}" destdir="${src.dir}" overwrite="false" encoding="UTF-8" version="1.2"/>

generates classes with "package null" thus placing superclasses (classes with underscore) in the source root.

If I change it to:

<cgen map="${db.map}" destdir="${src.dir}" overwrite="false" encoding="UTF-8" version="1.2"
superpkg="com.mycompany.schema"/>

Then it all works. The UI tool generates classes with the same maps just fine. Something is missing here:

1. If the package happens to be null then the task should fail instead of completing normally with a hint of what's wrong.
2. Should not the package be taken from the map file, from at least

<property name="defaultPackage" value="com.mycompany.schema"/>
?


--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Search Discussions

  • Anonymous at Jan 9, 2008 at 3:55 pm
    [ https://issues.apache.org/cayenne/browse/CAY-958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12677#action_12677 ]

    Andrus Adamchik commented on CAY-958:
    -------------------------------------

    IIRC I observed this behavior too and agree that we should use either the subclass package or the DataMap package. Not that class generation code underwent very significant changes since M2, but I believe this problem is still around and needs to be addressed.
    cgen ant task generates nonsense if superpkg attribute is missing, should fail instead
    --------------------------------------------------------------------------------------

    Key: CAY-958
    URL: https://issues.apache.org/cayenne/browse/CAY-958
    Project: Cayenne
    Issue Type: Bug
    Affects Versions: 3.0
    Environment: should not matter, but XP SP2 with all latest, sun java 1.6.0_03
    Reporter: Michael Bergens
    Assignee: Andrus Adamchik

    with the 3.0M2 Cayenne distro, this ant task:
    <cgen map="${db.map}" destdir="${src.dir}" overwrite="false" encoding="UTF-8" version="1.2"/>
    generates classes with "package null" thus placing superclasses (classes with underscore) in the source root.
    If I change it to:
    <cgen map="${db.map}" destdir="${src.dir}" overwrite="false" encoding="UTF-8" version="1.2"
    superpkg="com.mycompany.schema"/>
    Then it all works. The UI tool generates classes with the same maps just fine. Something is missing here:
    1. If the package happens to be null then the task should fail instead of completing normally with a hint of what's wrong.
    2. Should not the package be taken from the map file, from at least
    <property name="defaultPackage" value="com.mycompany.schema"/>
    ?
    --
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.
  • Anonymous at Jan 10, 2008 at 2:57 pm
    [ https://issues.apache.org/cayenne/browse/CAY-958?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Andrus Adamchik closed CAY-958.
    -------------------------------

    Resolution: Fixed
    Fix Version/s: 3.0

    I tested it with the latest code from trunk, and the bug appears to be gone.... So I am assuming that generator rework done when implementing CAY-927 miraculously addressed this issue as well. I uploaded cayenne-server from the trunk build here:

    http://people.apache.org/~aadamchik/nightly/01102008/cayenne-server-3.0-SNAPSHOT.jar

    It does what the docs say: "superpkg [...] If omitted, each superclass will be assigned the same package as subclass."

    Let me know if the problem persists with the new Cayenne... And if so, please provide more details, e.g. do you have classes in the default package or something?
    cgen ant task generates nonsense if superpkg attribute is missing, should fail instead
    --------------------------------------------------------------------------------------

    Key: CAY-958
    URL: https://issues.apache.org/cayenne/browse/CAY-958
    Project: Cayenne
    Issue Type: Bug
    Affects Versions: 3.0
    Environment: should not matter, but XP SP2 with all latest, sun java 1.6.0_03
    Reporter: Michael Bergens
    Assignee: Andrus Adamchik
    Fix For: 3.0


    with the 3.0M2 Cayenne distro, this ant task:
    <cgen map="${db.map}" destdir="${src.dir}" overwrite="false" encoding="UTF-8" version="1.2"/>
    generates classes with "package null" thus placing superclasses (classes with underscore) in the source root.
    If I change it to:
    <cgen map="${db.map}" destdir="${src.dir}" overwrite="false" encoding="UTF-8" version="1.2"
    superpkg="com.mycompany.schema"/>
    Then it all works. The UI tool generates classes with the same maps just fine. Something is missing here:
    1. If the package happens to be null then the task should fail instead of completing normally with a hint of what's wrong.
    2. Should not the package be taken from the map file, from at least
    <property name="defaultPackage" value="com.mycompany.schema"/>
    ?
    --
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categoriescayenne
postedJan 9, '08 at 3:46p
activeJan 10, '08 at 2:57p
posts3
users1
websitecayenne.apache.org

1 user in discussion

Anonymous: 3 posts

People

Translate

site design / logo © 2021 Grokbase