-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Difference in Oracle and Sql Sever using mapped collection
PostPosted: Mon Oct 22, 2007 11:40 am 
Newbie

Joined: Fri Oct 19, 2007 10:31 am
Posts: 1
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.