Closed bjouhier closed 13 years ago
Thanks a lot Bruno!
I really like the idea of adding Mixins to this. Some type of inheritance support was on my wish list for a long time now, maybe mixins is the way to go. I would like to make one change to the API, however. Generally I don't like "magic boolean arguments", a subtle "true" passed somewhere that quite radically change the meaning of the method, as was the case in your define
implementation. I separated out the mixin stuff into defineMixin
. I have the code living on my integration branch, which you can have a look at if you want. If this change is OK with you I'll merge it into master as well.
Thanks for the great work!
Zef
This change is perfectly fine. I was not too happy with the true parameter anyway.
The first implementation that I posted yesterday does not handle many to many relationships. I'm working on it. I hope to get it cracked later today.
Bruno
Hi Zef,
I've made a few commits this week-end.
The first ones are rather boring. Just a bit of cleanup in the type mapper (I moved the dbValToEntityVal and entityValToDbVal methods inside the type mapper block). I also documented the commit/rollback API (I still need to document the type mapper and provide a unit test - I'll do that a bit later).
The last commit is more interesting. I started to implement a "mix-in" feature. It enables polymorphic relationships. I have only tested a very basic case so far but I wanted to post it to get early feedback from you. I've put a bit of documentation in the readme and I've added a unit test.
I'm also planning to add support for "is a" relationships (classical inheritance) between entities. This should be easy once mix-ins are in place.
Thanks for the OR filters. I needed them.
PS: I commited another version this morning. I simplified the code to handle polymorphic relationships.
Bruno