Results 1 to 3 of 3

Thread: @DiscriminatorColumn

  1. #1
    Join Date
    May 2006
    Location
    Madrid
    Posts
    382

    Default @DiscriminatorColumn

    Is it possible to specify a @DiscriminatorColumn using Roo for an entity that is going to be the parent of an inheritance structure?

    I see that the "_Roo_Entity" class has a "declare @type: OpcionMenuApl: @DiscriminatorColumn;" sentence, but I see no options in the entity command to set a value for it.

    (I know that I can put the @DiscriminatorColumn in the java class, but I prefer to obtain all the infrastructure using script Roo commands)

    Thanks.

  2. #2
    Join Date
    Dec 2005
    Posts
    929

    Default

    Looking at the EntityMetadata code I can see the @DiscriminatorColumn is added if the "inheritanceType" attribute of the entity command is specified as SINGLE_TABLE. There is also a code comment:
    // Theoretically not required based on @DiscriminatorColumn JavaDocs, but Hibernate appears to fail if it's missing
    Alan Stewart
    Spring Roo Committer
    twitter @alankstewart

  3. #3
    Join Date
    May 2006
    Location
    Madrid
    Posts
    382

    Default

    Quote Originally Posted by Alan Stewart View Post
    Looking at the EntityMetadata code I can see the @DiscriminatorColumn is added if the "inheritanceType" attribute of the entity command is specified as SINGLE_TABLE. There is also a code comment:
    Thanks for the explanation.

    By the way, I think it would be a good idea to add commands to Roo for generating annotations for entities and attributes (JPA annotations, for instance)

    Kind regards.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •