Link to home
Start Free TrialLog in
Avatar of Melodi Roberts
Melodi RobertsFlag for United States of America

asked on

grailsinaction chapter 3 problems with 1:1 mapping

See attached files for user and profile domains.

Once I add the profile to the user, when I try to create user data with the following line in the console: new com.grailsinaction.Guser (userId: 'joeeeee', password: 'secret').save(), I get the result : Execution Complete. Result is null and no records are committed to the database.

I cannot see what I'm doing wrong. Guser.groovy.txt Profile.groovy.txt
Avatar of Melodi Roberts
Melodi Roberts
Flag of United States of America image

ASKER

Here is some additional information.  Below is what the generated database table looks like. Shouldn't the profile_id be NOT NULL?

I have configuration set to create-drop, so I know it should be picking up these changes to the Guser domain.

ID                                        NOT NULL NUMBER(19)
VERSION                                   NOT NULL NUMBER(19)
DATE_CREATED                              NOT NULL TIMESTAMP(6)
PASSWORD                                  NOT NULL VARCHAR2(255 CHAR)
PROFILE_ID                                NOT NULL NUMBER(19)
USER_ID                                   NOT NULL VARCHAR2(255 CHAR)
ASKER CERTIFIED SOLUTION
Avatar of schwertner
schwertner
Flag of Antarctica image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks.  I will go back to see the generated code to confirm the issue resolution once I have some time.