• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

one-to-many relationship: what is the design consideration ?

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to ask a question about JForum data design.

Category has many Forums, one-to-many (parent-child) relationship. But in Jforum, we didn't implement this relationship, just forum table has a category id. When deleting a category, it will check "CategoryModel.canDelete".

If we don't have this relationship, one question will arise. how to delete a category and cascade deleting forums ? More importantly, why do we have this 'loose' relationship design ? why we don't implement one-to-many relationship? what is your design consideration ?

Thanks.


[originally posted on jforum.net by czy11421]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is beacuse in that time mysql didn't has this kind of constraints, as far as I can tell.

Now, we can in fact fix this schema. You can open an issue in the bug tracker: http://www.jforum.net/jira

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

1. I have a mistake here, category-forum is implemented with one-to-many relationship. My fault.

2. Groups-users has many-to-many relationship, so we should have a bridge table, users_groups. But the problem is, users_groups don't add FK to group/user, it is independent. What is your design consideration ? Why not let RDMS to handle this relationship ?

3. I am just a student, I am learning data design from this project.

Thanks
[originally posted on jforum.net by czy11421]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I said before, there should be FKs there. It just handn't because some limitations of mysql back in time.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!