Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-805

Wrong generator for TABLE_PER_CLASS inheritance

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 1.1.0.M1
    • Fix Version/s: 1.1.0.M1
    • Component/s: PERSISTENCE
    • Labels:
      None
    • Environment:
      rev 812

      Description

      We cannot use a native, auto-generated id generator if we want to use TABLE_PER_CLASS inheritance

      example:

      LocalFile.java
      @Entity
      @RooJavaBean
      @RooToString
      @RooEntity
      @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
      public class LocalFile {
      ....
      }
      
      LocalFile_Roo_Entity.aj
      privileged aspect LocalFile_Roo_Entity {
      ...    
          @Id
          @GeneratedValue(strategy = GenerationType.AUTO)
          @Column(name = "id")
          private Long LocalFile.id;
      ...
      }
      

      I guess, Roo must generate:
      @GeneratedValue(strategy = GenerationType.TABLE)
      for entity which annotated with
      @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
      or provide possibility to change primary key generation strategy of annotated identifier field.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              balex Ben Alex
              Reporter:
              dzmitry Dzmitry Barouka
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: