Solved

grailsinaction chapter 3 problems with 1:1 mapping

Posted on 2011-03-14
4
317 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 48

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ejb on wildfly 5 30
How to create an alias for a column name in ORACLE sql ? 2 25
oracle differnce between two timestamps 5 31
Oracle 12c Default Isolation Level 17 41
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

840 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