Solved

grailsinaction chapter 3 problems with 1:1 mapping

Posted on 2011-03-14
4
309 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
Comment Utility
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
Comment Utility
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
Comment Utility
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.

Join & Write a Comment

Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
The viewer will learn how to implement Singleton Design Pattern in Java.

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now