Skip to content

MS SQL: failure when inserting row if a column has a foreign key constraint #744

@tsegismont

Description

@tsegismont

There are many tests in the HR suite using parent/child data. For example: EagerTest.

With MS SQL, these tests fail with:

javax.persistence.PersistenceException: org.hibernate.HibernateException: io.vertx.mssqlclient.MSSQLException: Cannot insert the value NULL into column 'parent_id', table 'master.dbo.Node'; column does not allow nulls. INSERT fails.

I suspect this is due to the column definition:

[Hibernate] create table Node (id int not null, string varchar(255), version int, parent_id int, primary key (id))

Perhaps it should be explicitly declared as NULL

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions