I am implementing inheritance mapping with D2 using the table class inheritance strategy. I have a parent class called Person with the following code code
namespace Zain\Entity;
class Person
{
...
And I have a child class called Employee with the following code:
namespace Staff\Entities;
class Employee extends \Zain\Entity\Person
{
...
MySQL table: tblPerson has a Discriminator column called Specialty, defined as:
`Specialty` varchar(45) NOT NULL
The problem occurs when I have an instance of Employee and try to save it.
When the Employee instance is saved, I expect the object name, employee (row) to be stored in the Specialty column of the Person table. However, this did not happen. I come across an error message:
Message: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'specialty' cannot be null
, , Specialty SQL, EntityManager. Not Null tblPerson > Column Specialty.
, , . , , SQL, / persist?
, . .