Re: Help with this db design
Re: Help with this db design
- Subject: Re: Help with this db design
- From: Guido Neitzer <email@hidden>
- Date: Fri, 21 Mar 2008 19:09:48 -0600
Some notes:
1. On Person there is "studyLevel" where it should be something like
"study_level_id" or "id_study_level" (as you named other fks on
PersonXConvoc).
2. You are mixing underscore notation with camel case. Decide what you
want and use that. Don't mix.
3. "address" as a varchar on Person is nothing I'd want to use but
might be sufficient for the situation. Also 255 chars seems small.
4. Don't model the PersonXConvoc as it is - you are not building a raw
join table here, it has more info. Give it a better name and a
dedicated primary key. This will make your work easier with EOF.
5. "studyLevel" should be "StudyLevel" when staying with camel case.
6. "Convocation", the description column seems to be pretty small with
255 chars.
When modeling the entities in Entity Modeler:
- Entity names start with an upper case character
- Class names should include a package and start with an upper case
character
- Attribute names are start with a lower case character
- remember that pks and fks are NOT class properties
- remember to model the correct relationships in both directions
cug
On 21.03.2008, at 18:54, Gustavo Pizano wrote:
Ok this is what I have aftere thinking better...
I hope its fine now because Im doing the EOModel.
<modeloRelacional.pdf>
Gus
On Mar 21, 2008, at 2:56 PM, Jean-François Veillette wrote:
Hmmm ...
- what is id_persion in Person table ? it look like a self
relationship (maybe pointing to a parent) ? if so, give it a
meaningful name (like id_parent or ...)
- what is id_convocation in Person table ? it look like an error,
either a Person has a to-many relationship with Convocation
(through PersonXConvoc) or a to-one with this as a foreign key.
- the old Person primary key id varchar(16) is now an integer,
good. But where is the information that was previously in this
varchar(16) ? is it the new 'document' attribute ?
I suggest, you explain (keep it high level) what are the entities,
what are the relationship between them (including cardinality), it
will be easier to discuss about the implementation in a rdbms.
- jfv
Le 08-03-21 à 14:32, Gustavo Pizano a écrit :
Ok this is what I did. hAving in mind what Jean and James
suggested.<db.pdf>
I know that there should be a middle table to avoid a many2many
relation, i tought that table could be PersonXConv, if no correct
me please.
I want to start from a good db design and UML desing, (I guess
apply for WO too), so I will not have "so many" problems later on.
Thank a lot
Gustavo
On Mar 21, 2008, at 12:46 PM, Jean-François Veillette wrote:
Assuming the relation between a Person and a Convocation is a
many-to-many with a qualified state, you already have your pk and
fk, just not marked appropriately.
In PersonXConvoc, both id_person _and_ id_convocation should be
primary key (as in ExpertiseXPerson).
In EOModeler, you probably do not want the many-to-many to be
modeled though (Person <<-->> Convocation), because if you do so,
you won't have access to your 'state' attribute.
You will have to model the middle table as an entity by itself,
so give it a meaningful name (?Assignment?Meeting?Appointment?).
You will end up with Person <-->> ?Appointment? <<--> Convocation.
I also suspect that the Person id (the primary key) is meaningful
for the user (because you gave it a varchar(16) type), if so, try
to avoid whenever possible (99.99%) to have an attribute that is
also a primary key. Juste give a person a numeric pk (as in
other tables). Since that pk is used as foreign key in other
table, you will avoid trouble later on, when you start updating
this attribute (assuming it's mutable).
- jfv
Le 08-03-21 à 12:54, Gustavo Pizano a écrit :
Well, as you may see db design its not my best quality, I have
done a design here, but I have a problem at how to connect the
PersonXConv with the Person entity, dunno where to put the FK,
any help please? andy suggestion?
F= FK
P=PK
N=NOT NULL
if you need some more info about the model let me know..
Gustavo
PS I jsut wanna have the model well designed so the rest, (in
Hibernate and OFF COURSE in WO ) will be fine so I can show the
teacher the wonders of WO.
<db.pdf>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
--
http://www.event-s.net
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden