Re: Default values in EOF
Re: Default values in EOF
- Subject: Re: Default values in EOF
- From: David Holt <email@hidden>
- Date: Wed, 27 Apr 2005 10:53:07 -0700
You can set default values in your Java code when you instantiate the object, can't you? I do this all the time. Then, when you save changes, the default value is written into the database.
David
--
You come to see . . . that suffering is required; and you no more want to avoid it than you want to avoid putting your next foot on the ground when you are walking. In the spiritual path, joy and suffering follow one another like two feet, and you come to a point of not minding which "foot" is on the ground. You realize, on the contrary, that it is extremely uncomfortable hopping all the time on the joy foot.
John G. Bennett
<x-tad-smaller>from Sunbeams: http://www.thesunmagazine.org</x-tad-smaller>
On 27 Apr 2005, at 10:44 AM, email@hidden wrote:
Hi Guido,
yes, i think you didn't understand me.
Validation will not help.
in Database you can add for every column(Attribute) a default value
example:
table has columns: name, surname, age, etc.. and isValid.
isValid is a bit column, it has a default value in the Database like "1" for
true and refuses NULL value .
So EOF wants to write.
validateForSave() will checks weather isVaild is not NULL, is it null an
exception will thrown.
usually if you use sql this will not happen because the database notes that
isValid has a default value "1". therefore it accepts your new row.
EOF unfortunately does NOT know anything about default values in the
database, and validateForSave() will throw definitely an exception.
Hope this explains my problem.
peaSe,
Sako.
----- Original Message -----
From: "Guido Neitzer" <email@hidden>
To: <email@hidden>; "WebObjects Dev (Apple)"
<email@hidden>
Sent: Wednesday, April 27, 2005 7:31 PM
Subject: Re: Default values in EOF
"email@hidden" <email@hidden> wrote:
Any can give me a hint to solve this?
Perhaps I don't understand your problem, but what about validation?
cug
Hello,
i have in the databse some default values for some attributes.
Some of these attributes do not accept null.
My problem is, EOF does not know the attributes have default value. if
user
does not inserts any value an exception is thorwn.
Any can give me a hint to solve this?
Thank you,
Sako.
_______________________________________________
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
_______________________________________________
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