CREATE TABLE zones (
	zone_id int NOT NULL ,
	prefix varchar (16) NOT NULL ,
	name varchar (64) NOT NULL ,
	CONSTRAINT PK_zones PRIMARY KEY
	(
		zone_id
	),
	CONSTRAINT FK_zones_to_objects FOREIGN KEY
	(
		zone_id
	) REFERENCES objects (
		id
	)
)
GO


INSERT INTO classes (type, db_name, table_name, java_class)
	VALUES(7,	'building2', 'zones', 'org.bodington.server.realm.Zone')
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(7, 1, 'zone_id', 'setZoneId', 'getZoneId', 'org.bodington.database.PrimaryKey', 'org.bodington.database.PrimaryKey', 1, null, null, null )
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(7, 2, 'prefix', 'setPrefix', 'getPrefix', 'java.lang.String', 'java.lang.String', 0, null, null, null )
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(7, 3, 'name', 'setName', 'getName', 'java.lang.String', 'java.lang.String', 0, null, null, null )
GO


