Announcement Announcement Module
Collapse
No announcement yet.
Data in surname, firstName combined into a single column? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Data in surname, firstName combined into a single column?

    I created a simple class containing a surname (-notNull -maxSize 50) and a firstName (-maxSize 50) field. I then created the automatic web controller, and started up the SpringSource tc server (this is all being done from the SSTS 2.1.0.RC1).

    The web form displays the "List All" and "Create New" options. Selecting "Create New" displays the form with textboxes for both surname and firstName. I enter a value in each and press save.

    Then, I select "List All", and the row I just entered is displayed, but the the surname and the first name I entered is displayed as "Surname,FirstName" in the Surname field and the firstName field is blank. Using a SQL client to view the database reveals that the data for the two fields has been concatenated together, separated by a comma and stored in the surname column. The firstName column is null.

    Is there something I missed to prevent Roo from being "smart" and combining the two name elements into the single column?


    Thanks,
    Maury

  • #2
    Originally posted by MjH View Post
    I created a simple class containing a surname (-notNull -maxSize 50) and a firstName (-maxSize 50) field. I then created the automatic web controller, and started up the SpringSource tc server (this is all being done from the SSTS 2.1.0.RC1).
    (Note the above should be -sizeMax, not -maxSize)

    After doing some more digging, this may be related to one of the issues described in http://forum.springsource.org/showthread.php?t=73887 (in my case only one of the columns has the NotNull constraint) and http://jira.springframework.org/browse/ROO-96 (in my case the separating character is a comma not a space).


    Maury

    Comment


    • #3
      hello,

      as Stefan pointed out in the thread you quoted, a workaround for this issue is if you set the -sizeMax to 30 or below.

      Attila

      Comment

      Working...
      X