I have the following in my mapping file.
<map name="MyProperties" table="N_PROPERTY" lazy="false" sort="unsorted" inverse="false" cascade="all-delete-orphan">
<key column="N_ID"></key>
<index column="N_KEY" type="java.lang.String" />
<element column="N_VALUE" type="java.lang.String" not-null="false" unique="false" />
</map>
My database has the following table in sql server:
CREATE TABLE N_PROPERTY(
N_ID bigint NOT NULL,
N_KEY nvarchar(30) NOT NULL,
N_VALUE nvarchar(2000) NULL,
CONSTRAINT PK_N_PROP PRIMARY KEY NONCLUSTERED (N_ID, N_KEY)
)
and also in oracle
CREATE TABLE N_PROPERTY(
N_ID NUMBER(19, 0) NOT NULL,
N_KEY NVARCHAR2(30) NOT NULL,
N_VALUE NVARCHAR2(2000),
CONSTRAINT PK_N_PROP PRIMARY KEY (N_ID, N_KEY)
)
I then add two properties to the map, A=NULL & B="" and save my class. In sql server B saves and A does not. In oracle both A & B save with NULL values. Does anyone know why there is this difference and if it can be fixed? Has anyone else encountered this issue?
|