Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [stellation-res] Database abstraction

On Tuesday 13 August 2002 02:06 pm, Mark C. Chu-Carroll wrote:
>
> Here's the original SQL:
>
> 	CREATE TABLE Properties (INTEGER aid,
> 					        INTEGER vid,
> 					        INTEGER inheritable,
> 						VARCHAR(200) name,
> 						VARCHAR(1600) value,
> 			CONSTRAINT fk3 FOREIGN KEY (aid, vid) REFERENCES Versions(aid, vid)
> 			PRIMARY KEY(aid, vid, name))
>

OK... Here's the new version:
AbstractDatabase db;
String command = "CREATE TABLE Properties" + 
		db.getIntegerType() + " aid, " +
		db.getIntegerType() + " vid, " +
		db.getIntegerType() + " inheritable, " +
		db.getShortStringType() + " name, " +
		db.getLongStringType() + " value," +
	        "CONSTRAINT fk3 FOREIGN KEY (aid, vid) " +
		" REFERENCES Versions(aid, vid), " +
		 "PRIMARY KEY(aid, vid, name)" +
		 db.getCreateTrailer();

It's enough to get past the differences in datatypes between the
databases, and to let us automatically insert the DDL annotations
that are used in MySQL to specify InnoDB tables.

Is this less objectionable?

	-Mark

-- 
Mark Craig Chu-Carroll,  IBM T.J. Watson Research Center  
*** The Stellation project: Advanced SCM for Collaboration
***		http://www.eclipse.org/stellation
*** Work Email: mcc@xxxxxxxxxxxxxx  ------- Personal Email: markcc@xxxxxxxxxxx




Back to the top