[Modeling-users] Waht about using relations with NOT AUTONUMERIC primary keys?
Status: Abandoned
Brought to you by:
sbigaret
From: Javier C. <jav...@ne...> - 2004-07-29 23:22:49
|
Hi: I has a ask for you about Modeling. The thing is, i'm accostumed to work with 'system tables' in some ER models i work... These system tables serve for this... Let's say we have a Person, and a Person can have different document 'types'... then , i model this like that.. PERSON(id, name, fk_idSisDocumentType, documentNumber, ....) SisDocumentTypes(id, description) Where that 'system table' will have data like those: (1, 'DNI') (2, 'CUIT') (3, 'LE') ... and in person we can have: (1, 'Javier', 1, '25.948.547') (2, 'Alejandro', 2, '45.456') (3, 'Jaime', 3, 'AC-1234') Well, i want to know if there is some way to model this on Modeling, cause i saw that each no-abstract entity on Modeling 'must have' APrimaryKey... On my example, id on SisDocumentTypes IS A PRIMARY KEY for that relation... and IS A FOREIGN KEY for PERSON relation... but in modeling, each PrimaryKey on and Entity in a PyModel, is always a SEQUENCE on the underlying database? How can i then model that on Modeling? I dont want that modeling creates an 'automumeric' key on SisDocumentTypes... cause these values are not inserted by the final user of the system, but yes by me! That relation is 'initialized' with the allowed values on deployment of the database, and then it can't be modified by the final users. Final user just can select those values from a "combobox" on Person's insert/update form. I hope i'm making me understood, cause english is not my native language. :) I though that i could create SisDocumentTypes like that: model.entities = [ Entity ('SisDocumentTypes', properties = [ AInteger('id'), AString('description') ] ] But, then.... id is not primary key, and i can't do a simple Association with that relation :( Please, help me!! Javier A. Castro Nexion Software Italia 1508, 1º Piso, Of. 2 CP 8332 - General Roca - Río Negro www.nexion.com.ar |