AutoIncrementSequenceFactory.
Hi,
I am trying to use the AutoIncrementSequenceFactory with sql server.
When I try to insert an object into the table the database complains that
there are null values.
I assume this is due to the fact that kodo executes
INSERT INTO table DEFAULT_VALUES;
The default value is null, and the table does not allow nulls. I cannot
change our validation rules and allow null values just so that auto
increment keys work.
Please help.
Regards
Craig.
Craig,
The way we handle auto-incrementing columns (IDENTITY columns in
SQLServer-speak) is to insert a placeholder row into the database, obtain
the ID value that was inserted, and delete the row from the database. We
then use the retrieved ID later when we insert the proper data into the
database.
So, by default, for SQLServer, we just use default values for the table.
You can get around this by extending our SQLServerDictionary and
overriding the behavior of the getAutoIncrementValue() method to do
something other than what we do.
In the future, we may add a mechanism to control some of this behavior
from the class's XML metadata file. But in the mean time, you'll have to
just encode the appropriate logic that special-cases those tables for
which you can't use default values into the dictionary yourself.
-Patrick
On Sun, 18 May 2003 06:17:53 -0400, Craig Main wrote:
Hi,
I am trying to use the AutoIncrementSequenceFactory with sql server.
When I try to insert an object into the table the database complains
that there are null values.
I assume this is due to the fact that kodo executes INSERT INTO table
DEFAULT_VALUES;
The default value is null, and the table does not allow nulls. I cannot
change our validation rules and allow null values just so that auto
increment keys work.
Please help.
Regards
Craig.--
Patrick Linskey
SolarMetric Inc.
Similar Messages
Maybe you are looking for
-
Upgrade to iOS 6.1 freezes iphone 4 - alternative resolution
Up til 2 weeks ago, my iPhone 4 was working great, but all of a sudden it started to hang or freeze on some regular apps. Looking back, it may have something to do with iCloud linking to my iPad or perhaps a corrupt app, but I make a point of delibe
-
The tone was ONCE available on my phone, but I've no idea where it went. It remains on my iTunes page, however. Any ideas?? Thanks!
-
Is it possible to have documents side by side for editing purposes?
-
Where is the ARH (AIR Runtime Helper) utility?
Hello, AIR Runtime redistributable documentation mentions the ARH (AIR Runtime Helper) which is a tool that can detect which version of the AIR runtime and which version of my app is installed on the user's machine. However I cannot find this utility
-
User description after the user was deleted
Hello, Im not a basis expert but have a theoretical question. If I had a user named DAN_A, which is not working anymore in the company and I want to delete the user because I dont want to pay for its license. In a few years I would like to know t