Hibernate trouble: INSERT instead of UPDATE when using Inheritance:SINGLE_TABLE and SecondaryTables
问题 I have implemented inheritance hierarchy using SINGLE_TABLE with SecondaryTables. This works otherwise, but when my secondary table's field(s) are empty (= null in Oracle), next update to the entity fails since Hibernate thinks it should INSERT to the table when it should UPDATE. Example: CREATE TABLE TASK ( ID NUMBER(10) NOT NULL , TYPE NUMBER(1) NOT NULL , STATUS NUMBER(1) NOT NULL , CONSTRAINT TASK_PK PRIMARY KEY (ID) ENABLE); CREATE TABLE SUB_TASK ( ID NUMBER(10) NOT NULL , TEXT VARCHAR2