Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-942

Generic types

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 3.0
    • None
    • None

    Description

      I realize that this would restrict functionality to Java 5+, but I still believe it would be a good option to have for the code generator in the modeler:

      Add, as an option, generic types to Lists in generated classes. It's quite annoying to have to cast types; much of my code looks like this:
      for(Object o : someObject.getSomeManyToManyField()) {
      TheTypeIWanted ttiw = (TheTypeIWanted) o;
      ...
      }

      With generics, it would be:
      for(TheTypeIWanted ttiw : someObject.getSomeManyToManyField()) {
      ...
      }

      It'd also be nice if the core libraries had generics. For example, "Object DataObjectUtils.objectForPk(Class, int)" could be changed to "T DataObjectUtils.objectForPk(Class<T>, int)" to avoid casting.

      Attachments

        Activity

          People

            ari Ari Maniatis
            scotta Scott Anderson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: