agentgt / jirm

A Java Immutable object Relational Mapper focused on simplicity, convenience, and thread safety.
Apache License 2.0
66 stars 10 forks source link

Recursive dao call ability was added #38

Open buzden opened 10 years ago

buzden commented 10 years ago

Dao was changed to make able to insert the recursive structure of objects automatically.

Only a stub was added for the update and reload operations.

This change is backward-compartible. It it going after the dao-hooks pull request for easing of merging (is case of acceptance).

agentgt commented 10 years ago

The problem with the recursive dao idea is how do you know when to insert child objects or just associate?

In my opinion and this is after dealing with hibernates recursive support (ie graph serialization), Its not that much work to manually insert children and is more explicit about what is actually happening.

buzden commented 10 years ago

I agree that what should be done with a child is a not a thing that should be hardcoded in a library.

But what I suggested in this pull request is to give a library user a chance to do something with a child (by setting a kind of a callback) and do nothing by default. No predefined decisions were made and flexibility was improved, to my point of view.