Paste: new define-persistent ideas
Author: | erg |
Mode: | factor |
Date: | Thu, 16 Apr 2009 19:25:28 |
Plain Text |
TUPLE: manufacturer id name ;
TUPLE: color id name ;
TUPLE: car id manufacturer-id color-id year model ;
PERSISTENT: car {
COLUMN{ { id "foooid" } { INTEGER } { NOT-NULL SERIAL PRIMARY-KEY } }
COLUMN{ manufacturer-id R{ manufacturer id }
COLUMN{ year INTEGER }
COLUMN{ model VARCHAR }
}
RELATION: car.manufacturer-id manufacturer.id
DEFAULT-RELATION: car manufacturer
RELATION: car.color-id color.id
DEFAULT-RELATION: car color
TUPLE: person id name ;
TUPLE: group id name ;
TUPLE: person-group person-id group-id ;
PERSISTENT: person "person" {
DEFAULT-ID
COLUMN{ name { VARCHAR 256 } }
}
PERSISTENT: group "group" {
DEFAULT-ID
COLUMN{ name { VARCHAR 256 } }
}
PERSISTENT: person-group {
COLUMN{ person-id R{ person id } }
COLUMN{ group-id R{ group id } }
INDEX{ { person-id group-id } PRIMARY-KEY }
}
New Annotation