[hibernate-dev] New unified XML handling
Steve Ebersole
steve at hibernate.org
Sun Feb 9 13:15:49 EST 2014
On Sun, Feb 9, 2014 at 10:25 AM, Gunnar Morling <gunnar at hibernate.org>wrote:
> 2014/2/9 Steve Ebersole <steve at hibernate.org>
>
>> Gail, et al.
>>
>> I am starting to integrate the new unified XML handling into the process
>> of
>> building a Metadata object. Logically this sits at the level of "source
>> processing" (source package). The concept of a MetadataSourceProcessor is
>> kind of obsolete because there is just one process to apply (annotations
>> +xml-overrides & metadata-complete-xml).
>>
>> Because the output of this unified process is a Jandex index, one option
>> is
>> to replace "source" with direct Jandex.
>
>
> How is the Jandex index created in case of XML?
>
We create virtual information inside the Jandex index to incorporate the
XML mapping info.
>
>
>> Another option is to keep "source"
>> and have it be a wrapper around Jandex. This second option is likely
>> quicker turnaround since we can mostly reuse the annotation source
>> processor code. Also, wrapping the Jandex calls this ways lets us apply
>> some simplification of the questions we ask of the data. Not to mention
>> it
>> would probably be a good idea to encapsulate as much as possible this
>> reliance on external libs. There are some concerns to this approach
>> though
>> to my mind. My main concern is performance, as this requires us to
>> instantiate all the "source" wrappers around Jandex.
>>
>> What do y'all think?
>>
>
> What other concerns are there besides performance?
>
> Design-wise, wrapping Jandex seems advantageous to me, in particular as it
> allows to add more semantical methods to these objects (I think that's what
> you meant by "apply some simplification of the questions we ask of the
> data").
>
Yes, I think we are saying the same thing. In fact these semantics are
already defined by the org.hibernate.metamodel.spi.source package. My
other concern is conceptual at the moment in that we designed this SPI
based on a logical unification between JPA (annotations+orm.xml) and
hbm.xml sources. I just wonder if the semantics are still good enough (not
too restrictive, etc) given that we now have a real unification of the
mapping info. Likely the SPI just needs minor evolution.
More information about the hibernate-dev
mailing list