Announcement Announcement Module
Collapse
No announcement yet.
"field set" with or without --cardinality generates the same code Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • "field set" with or without --cardinality generates the same code

    I am trying this 2 commands on Roo console (playing around with 1.1.0M1)

    Code:
    field set --fieldName iterations --element ~domain.Iteration
    Code:
    field set --fieldName iterations --element ~domain.Iteration --cardinality
    I understood that the first will generate a @ManyToMany set and the second one should create a @OneToMany (as per the last part of http://static.springsource.org/sprin...x.html#d4e1365). But for both I'm getting this:

    Code:
        @ManyToMany(cascade = CascadeType.ALL)
        private Set<com.pm.domain.Iteration> iterations = new java.util.HashSet<com.pm.domain.Iteration>();
    Is this something that changed on 1.1.0M1? How can I force a OneToMany to be generated?

    Thanks

  • #2
    Same problem here

    I also hava problem with sets.

    My code is

    Code:
    @ManyToMany(cascade = CascadeType.ALL)
        private Set<~.server.domain.Person> artists = new java.util.HashSet<~.server.domain.Person>();
    It results in errors like
    BandRecord.artists cannot be resolved
    SetRecord cannot be resolved to a type

    any help would be appreciated

    Comment


    • #3
      I guess cardinality has options. Did you try out

      field set --fieldName iterations --element ~domain.Iteration --cardinality ONE_TO_MANY
      The default for cardinality without any options is MANY_TO_MANY

      Comment


      • #4
        yes you are right.. thx for pointing that out

        Comment

        Working...
        X