Jun 27th, 2009, 07:31 PM
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?
Jun 27th, 2009, 08:06 PM
(Note the above should be -sizeMax, not -maxSize)
Originally Posted by MjH
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).
Jun 28th, 2009, 03:29 PM
as Stefan pointed out in the thread you quoted, a workaround for this issue is if you set the -sizeMax to 30 or below.