db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tillich, Adrian" <Adrian.Till...@tui.de>
Subject torque and nullable foreign keys
Date Tue, 09 Dec 2003 18:27:29 GMT
Hi,

I have this problem:
an insert on a simple database table 
like this:
	CREATE TABLE CITY_MAP
	(
		CITY_NAME	varchar(20)	NOT NULL,
		CITY_ID	int 		NULL,
		
		CONSTRAINT PK_MAP
	            	PRIMARY KEY NONCLUSTERED (CITY_NAME)
	)
	go

	ALTER TABLE CITY_MAP
	     ADD FOREIGN KEY (CITY_ID)
	            REFERENCES CITY_ID
	go

fails, because Torque sets the foreign key field CITY_ID to a numeric 0
instead of NULL.
This is probably because the corresponding Torque-Peerclass uses the flat
datatypes instead of the Objects for numeric datatypes.

Can I somehow configure this behaviour or is there a workaround?

Changing the database model is not really an option because I use an
existing one.

Thanks,
Adrian


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message