Cayenne
  1. Cayenne
  2. CAY-56

Comments for entities, attributes and relationships

    Details

    • Type: Improvement Improvement
    • Status: Reopened
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 3.0M5
    • Fix Version/s: Short term future
    • Component/s: Core Library, Modeler
    • Labels:
      None
    • Environment:
      All

      Description

      It would be nice to be able add a comment or description to every attribute and relationship, both for data entities and object entities. The comment could not only be stored in cayenne.xml but could also be output to the Java code of the object entities. I seem to remember that some databases also support comments for tables and perhaps even columns.

        Activity

        Hide
        Jim Menard added a comment -

        An addendum: if a comment is added to a database attribute or relationship but not the corresponding object attribute or relationship, it would be nice to copy the former to the latter when generating Java code.

        Show
        Jim Menard added a comment - An addendum: if a comment is added to a database attribute or relationship but not the corresponding object attribute or relationship, it would be nice to copy the former to the latter when generating Java code.
        Hide
        Jim Menard added a comment -

        I wrote something about the comments being stored in cayenne.xml. That wouldn't be the place, of course: the map file would.

        Show
        Jim Menard added a comment - I wrote something about the comments being stored in cayenne.xml. That wouldn't be the place, of course: the map file would.
        Hide
        Andrus Adamchik added a comment -

        While I like the idea in general, loading comments in the app memory during the execution would probably be wasteful. So we may need an alternative MapLoader that skips comments.

        Show
        Andrus Adamchik added a comment - While I like the idea in general, loading comments in the app memory during the execution would probably be wasteful. So we may need an alternative MapLoader that skips comments.
        Hide
        Andrus Adamchik added a comment -

        I guess we won't be doing that just yet... maybe in the future

        Show
        Andrus Adamchik added a comment - I guess we won't be doing that just yet... maybe in the future
        Hide
        Andrey Razumovsky added a comment -

        Reopening the issue. Summary consists of several steps:
        1. Adding comments to entities/rels/attrs
        2. Modeler support
        3. Adding comments to merging, (re) engineering processes
        4??. Transfering comments to generated java classes

        Show
        Andrey Razumovsky added a comment - Reopening the issue. Summary consists of several steps: 1. Adding comments to entities/rels/attrs 2. Modeler support 3. Adding comments to merging, (re) engineering processes 4??. Transfering comments to generated java classes
        Hide
        Robert Zeigler added a comment -

        4 is a definite must, imo.
        It would be /so/ nice if we could have specialized forms of comments, or some way of describing /how/ to apply them (eg: javadocs, annotations, etc.), but, maybe that's too much to ask.
        Although.... we could do somthing as simple as: comments on db entitites are applied to the db; comments on obj entities are applied to the java class. At least for the java class, comments could be output raw. So I could add a comment that looks like:
        @DefaultOrder(

        {"a","b","c"}

        )

        to the obj entity and that would be applied directly to the java class. Just a thought; then the comments are very generic, from cayenne's perspective, but still useful directly by, eg, java.

        Show
        Robert Zeigler added a comment - 4 is a definite must, imo. It would be /so/ nice if we could have specialized forms of comments, or some way of describing /how/ to apply them (eg: javadocs, annotations, etc.), but, maybe that's too much to ask. Although.... we could do somthing as simple as: comments on db entitites are applied to the db; comments on obj entities are applied to the java class. At least for the java class, comments could be output raw. So I could add a comment that looks like: @DefaultOrder( {"a","b","c"} ) to the obj entity and that would be applied directly to the java class. Just a thought; then the comments are very generic, from cayenne's perspective, but still useful directly by, eg, java.
        Hide
        Ari Maniatis added a comment -

        I think this task should be closed as a duplicate of CAY-400. I hopefully have an experienced programmer as a migrant work experience person in a few weeks soon and I was going to ask them to work on that task. I don't see anything here which doesn't duplicate what is in CAY-400.

        Show
        Ari Maniatis added a comment - I think this task should be closed as a duplicate of CAY-400 . I hopefully have an experienced programmer as a migrant work experience person in a few weeks soon and I was going to ask them to work on that task. I don't see anything here which doesn't duplicate what is in CAY-400 .
        Hide
        Andrey Razumovsky added a comment -

        As we've already discussed, generic properties cannot be used as database comments, and that's one of the major features of this task. CAY-400 is just about generic comments (e.g. key-value pairs). This task was designed to have single 'comment' column. Anyways, if there's going to be progress in CAY-400, we can wait to see what will be done there first

        Show
        Andrey Razumovsky added a comment - As we've already discussed, generic properties cannot be used as database comments, and that's one of the major features of this task. CAY-400 is just about generic comments (e.g. key-value pairs). This task was designed to have single 'comment' column. Anyways, if there's going to be progress in CAY-400 , we can wait to see what will be done there first

          People

          • Assignee:
            Andrey Razumovsky
            Reporter:
            Jim Menard
          • Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:

              Development