Hi David,
yes i can set Default values in java code.
But i think this is a bad way.
Imagine another tool writes in the db also like ACCESS (ps,
this is the reality in my case), i must add the Default value in another place
also like ACCESS and database. At the first second looks easy and simple. but
this will accrue problems if the default values in the future for any (UNKNOWN)
reason are different. and this could happen easy.
According to, every time i change the default value i have to
recompile and release my Application.
for big applications this is a catastrophe.
However, if there is no another way, it seems to be, i will
get this way you mentioned.
I hoped another way exist.
peaSe,
Sako.
----- Original Message -----
Sent: Wednesday, April 27, 2005 7:53
PM
Subject: Re: Default values in EOF
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
-- /smaller>/fontfamily>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.
/color>John G. Bennett /fontfamily> from
Sunbeams: http://www.thesunmagazine.org/x-tad-smaller>/smaller>/smaller>
/smaller>/fontfamily> 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
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
email sent to email@hidden
|