Solved

grailsinaction chapter 3 problems with 1:1 mapping

Posted on 2011-03-14
4
314 Views
Last Modified: 2013-11-13
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
0
Comment
Question by:melodi_roberts
  • 2
4 Comments
 

Author Comment

by:melodi_roberts
ID: 35134547
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)
0
 
LVL 47

Accepted Solution

by:
schwertner earned 250 total points
ID: 35507471
You enter values for only two columns in your table.
But all columns have NOT NULL constraints.
So you have either to insert six non null values OR to drop some not null constraints.
0
 

Author Comment

by:melodi_roberts
ID: 36291684
Thanks.  I will go back to see the generated code to confirm the issue resolution once I have some time.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question