Results 1 to 5 of 5

Thread: set field problem: No converter found capable of converting...

  1. #1
    Join Date
    Nov 2010
    Location
    San Diego
    Posts
    18

    Default set field problem: No converter found capable of converting...

    Building a new project up in this mutha, and I'm running into some problems:

    I have a class that exists as the "many" side of a many to one relationship on three different classes.

    I declared this entity as follows:
    Code:
    entity --class ~.admin.Measurement
    And the three classes that will use it can use it as follows:
    Code:
    field set --element ~admin.Measurement --fieldName defaultMeasurement
    This field is optional for two of the classes, required for the third. Cool, right? But when I try to create an instance of one of the entities where Measurement is optional, I get this error:

    No converter found capable of converting from 'java.util.Set' to 'java.lang.String'
    Is there some additional configuration I need to perform in this case, or am I declaring my field wrong?

  2. #2
    Join Date
    Nov 2010
    Location
    San Diego
    Posts
    18

    Default

    Sorry if my previous post was sort of vague, but I really didn't do anything special that would warrant this problem. I set up my entities as described above, and then ran the old "controller all package web" command to get a basic scaffold going.

    Does this initial web setup not support the use of field set? I am trying to create an object that can contain many Measurements, but the field is not required.

    Bump
    Last edited by IcedDante; Nov 24th, 2010 at 06:18 AM.

  3. #3
    Join Date
    Nov 2010
    Location
    San Diego
    Posts
    18

    Default

    bump. Let me know if I can elaborate.

  4. #4
    Join Date
    Nov 2010
    Location
    San Diego
    Posts
    18

    Default

    Alright, I see how it is: I guess when you want to start building an interface for this it is necessary to start customizing some controllers and jsps for handling many-to-one/many-to-many relationships.

    At this point do we just create a controller and start customizing the view and controller like a normal Spring project? If so: time to start learnin me some spring! Also: is this the point at which Wicket can be used for the front end?
    Last edited by IcedDante; Dec 5th, 2010 at 12:27 AM. Reason: new questions asked

  5. #5
    Join Date
    Nov 2010
    Location
    San Diego
    Posts
    18

    Default

    To follow-up, I received some inquiries from people that wanted to know how to deal with this problem.

    There are a few things I did.

    One: if you are creating an entity that references one or more other entities then make sure you have some instances of this created. For example, if you are creating from within your web scaffold an entity of type Bus which contains several people, have the people instances created first.

    Two: Compartmentalize. Instead of having multiple entities reference a set, have them reference another entity. For example, if I have entity types Car, Plane, and Bus: each one references a Set of Persons. Better practice for Roo would instead be to create an entity called Roster which itself contains a set of Persons and then to have the other entities reference that.

    But basically the web interface you get with:
    Code:
    controller all --package ~.web
    is going to be limited and you will need to do some customization here. I only wish there was more reference documentation or support here on the forums for it.

Posting Permissions

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