google-code-export / dataobjectsdotnet

Automatically exported from code.google.com/p/dataobjectsdotnet
0 stars 0 forks source link

Validation of non-nullable reference field #728

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create Entity with Reference field with [Field(Nullable = false)] attribute
2. Try to create entity without filling fields
3. If use InMemory database there are no exceptions - wrong.
4. If use sqlserver there are:
Xtensive.Storage.CheckConstraintViolationException was unhandled
  Message=Error 'CheckConstraintViolation' while executing query 'INSERT INTO [dbo].[MyEntity] ([Id], [Text], [link.Id]) VALUES (@p1_0, @p1_1, @p1_2); [p1_0='1';p1_1='Hello World!';p1_2='']'. Original message: Cannot insert the value NULL into column 'link.Id', table 'DO40-Tests.dbo.MyEntity'; column does not allow nulls. INSERT fails.
The statement has been terminated.
  Source=Xtensive.Storage.Providers.Sql

why not ConstraintViolationException with information about null field before 
touching database?

What version of the product are you using? do 4.3rc5
On what operating system? win7

Please provide any additional information below.

Original issue reported on code.google.com by kl.v...@gmail.com on 7 Jul 2010 at 11:43

GoogleCodeExporter commented 9 years ago

Original comment by alex.yakunin on 9 Sep 2010 at 1:50

GoogleCodeExporter commented 9 years ago

Original comment by alex.yakunin on 21 Oct 2010 at 1:53

GoogleCodeExporter commented 9 years ago

Original comment by alex.yakunin on 21 Oct 2010 at 1:53

GoogleCodeExporter commented 9 years ago
Hmmm, any progress?

Original comment by v.tambov...@gmail.com on 3 Aug 2011 at 11:26