• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: exception with a not null constraint....
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: exception with a not null constraint....


  • Subject: Re: exception with a not null constraint....
  • From: Chuck Hill <email@hidden>
  • Date: Tue, 28 Apr 2009 08:15:12 -0700

Please keep messages on the list.


On Apr 28, 2009, at 4:12 AM, Theodore Petrosky wrote:


ok here we go...

I create a table with a repetition:
<table>
  <wo:WORepetition list = "$dg.displayedObjects" item = "$current">
//$current is of type Contact (it has the column dateInserted

I have in here an AjaxModalContainer. (label ="$current.companyName") ... click a companyName and get the modal dialog to edit the meta data
so far everything is ok.



</table>

interesting that I stuck a comment at the head of my saveEdits function

top of saveEditsToContact +++++++++++++++++++++++++++++
Apr 28 06:48:59 AffluentCooperative[50613] INFO NSLog - current.dateInserted() = 2009-04-25 04:00:00 Etc/GMT


current.dateInserted has a value however in the actual try block

INFO NSLog - ValidationException e = Please provide a <b>Date Inserted</b>.

I know that I would be thoroughly embarrassed to have a anyone actually look at my code, but I can export the whole project and let you see what I am doing. I use postgresql and migrations.

I don't get this....

Ted



--- On Mon, 4/27/09, Chuck Hill <email@hidden> wrote:

From: Chuck Hill <email@hidden>
Subject: Re: exception with a not null constraint....
To: "Theodore Petrosky" <email@hidden>
Cc: email@hidden
Date: Monday, April 27, 2009, 2:08 PM

On Apr 25, 2009, at 6:09 AM, Theodore Petrosky wrote:


I have an EO with a not null constraint on a date
columnn. I have a function that I call from a click that
sets a boolean (isDeleted) to true and saves the EO.

try { contactEO.saveChanges(); } catch (ValidationException e) {

NSLog.out.appendln("ValidationException e = " +
e.getMessage());

} catch (EOGeneralAdaptorException e) {

NSLog.out.appendln("EOGeneralAdaptorException e = " +
e.getMessage());
}
}

It is throwing an exception and claiming that the date
field is null

Does the model allow null for this attribute?  Did you
change the model after creating the database?


and violates the not null constraint. I don't have
anyplace in the interface that is wired to the date column
in question (it is the insertion date).

I guess I could just set the EO to accept nulls but I
thought I would try to understand why the saveChanges() is
trying to update the row with a null.


You are doing something wrong, either in your model or in your code (or, I guess, in both). This is the first thing to check: http://wiki.objectstyle.org/confluence/display/WO/EOF-Using+EOF-The+EOF+Commandments

Chuck

--Chuck Hill
  Senior Consultant / VP Development

Come to WOWODC'09 in San Fran this June!
http://www.wocommunity.org/wowodc09/







-- Chuck Hill Senior Consultant / VP Development

Come to WOWODC'09 in San Fran this June!
http://www.wocommunity.org/wowodc09/

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Inverse Relationships
  • Next by Date: Re: Inverse Relationships
  • Previous by thread: Re: exception with a not null constraint....
  • Next by thread: Quick Question about WONDER
  • Index(es):
    • Date
    • Thread