On Thu, Nov 12, 2015 at 2:44 PM Sanne Grinovero <sanne(a)hibernate.org> wrote:
Sounds like a very interesting patch, I agree with you that
there's
much potential.
Although Steve from your description it seems like you don't think it can
work?
Not sure I follow. You agree with the potential of the idea I am
proposing, but then point out how I don't think it will work. I am
confused :)
I guess I think there are different shades of "it works". I mean heck "it
works" as is already. I think it works *best* if there is no need to
"translate" from one canonical form to another. In other words, if
persisters and bytecode enhancements and dirty tracking all understood the
same attribute indexes I think that is by far the optimal situation
performance-wise.
I would expect something among the lines of what Gunnar described to
be feasible: to let the persisters figure out the right numbers when
they are created (once only). But I am not familiar enough with this
code area to get in the details.
But that's not what Gunnar proposed. Its the same thing I asked him to
clarify. He proposes the "other way"; have the enhancer define the order
and the persisters pick it up from the enhancer. Could that work? I
guess. Really I have no idea, so many unknowns there.
About the method you mentioned " $$_hibernate_read_name()" : who
invokes that, and when is the code which invokes that method
generated?
I'm assuming that would be part of the persister, so it means
persister implementations are defined at runtime via bytecode
manipulation?
That is a method generated by the enhancer. Generally speaking it builds a
reader/writer method pair for each "enhanceable" field. For readers, the
name of the method follows the pattern "$$_hibernate_read_{fieldName}().
The callers of this method are all done via enhancement as well.