• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Relational Database Tables using HABTM and BTM issue

[eluser]Daniel Moore[/eluser]
I know many people that prefer coding using Has-and-Belongs-To-Many (HABTM) and Belongs-To-Many (BTM) models from a good Object-relational Mapping (O/RM) library.

I have looked at several of these, and have been unable to find what I needed.

Perhaps I missed something, and perhaps someone here can point me in the right direction.

Here is my issue:
The libraries I have looked at (I'm not going to list them here) do not appear to handle relational mapping of files to database tables. They all appear to handle only table-to-table relationships. I for one use a database table, and have worked with many other people that do the same, to handle managing filenames on the server and what those files belong to. For example, a table might contain filename_field, filetype_field, user_id_field, etc. I know in this table that, for example, filename1.jpg would belong to user1, and filename1.doc would belong to user1, etc. This is definately a relational model here, and if the row in the database were to delete the user1, then the entries in the other table that list the filenames for user1 would also be deleted. I need it to delete the files as relational as well.

I have already done my own coding to handle this, which is fine for my current project. My question is, did I miss something? Do object-relational mapping libraries not handle this? We should be able to map ANY objects together in a perfect world (my theory, you may not agree) but the world isn't perfect. Therefore, we should at least be able to map together things that are commonly used together, right?

Does this already exist somewhere? I have searched Google, this forum, and several other forums, and multiple wikis and can't find what I'm looking for. Did I just have a bad day or does this not exist?

If it doesn't exist (outside of an expensive commercial product) then would anyone be interested if I were to write such a library this summer? I really don't want to spend my time re-inventing the wheel, and I don't want to polish it for public use if public isn't interested (i.e. writing documentation.)

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.