Results 1 to 4 of 4

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

Hybrid View

  1. #1
    Join Date
    Oct 2004
    Location
    costa rica
    Posts
    8

    Question "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
    alejandro

  2. #2
    Join Date
    May 2010
    Posts
    1

    Default 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

  3. #3
    Join Date
    May 2010
    Location
    India
    Posts
    16

    Default

    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
    Regards,
    Ramesh

  4. #4
    Join Date
    Oct 2004
    Location
    costa rica
    Posts
    8

    Default

    yes you are right.. thx for pointing that out
    alejandro

Tags for this Thread

Posting Permissions

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