[hibernate-dev] envers / new metamodel

Steve Ebersole steve at hibernate.org
Tue Sep 11 08:43:10 EDT 2012


I had forgotten that I actually had already wired this in...  The 
contract you want is 
org.hibernate.metamodel.spi.AdditionalJaxbRootProducer:
public interface AdditionalJaxbRootProducer {
	/**
	 * Produce and return the list of additional mappings to be processed.
	 *
	 * @param metadata The metadata (for access to binding information).
	 * @param jandexIndex The Jandex annotation index
	 *
	 * @return List of additional mappings
	 */
	public List<JaxbRoot> produceRoots(MetadataImplementor metadata, 
IndexView jandexIndex);
}

It is given (1) the fully bound "main model" and (2) Jandex and asked 
to produce JAXB roots (which is the JAXB representation of XML 
bindings, rather than DOM4J).


On Mon 10 Sep 2012 08:30:05 PM CDT, Steve Ebersole wrote:
> It wont be via Integrator.  This is the same discussion you and I had
> with Max wrt tooling.  I'll ping you when Jandex is available for use
> by Envers (I'll take care of all the wiring).  Hopefully should be
> done tomorrow or the day after.
>
> On 09/08/2012 05:37 AM, Łukasz Antoniak wrote:
>> Hello Hardy,
>>
>> Thank you for the clarification. This is what I thought initially by
>> looking at the code. I have reviewed the relevant mailing list topic,
>> and would agree that Jandex repository should be passed to integrator
>> somehow. Other Hibernate extensions probably introduce custom
>> annotations as well. Looking at MetadataSources#buildJandexView() I
>> suppose that Jandex indexes all annotations applied, not just a
>> predefined subset (JPA), so there would be no need for Envers to
>> create its own index. I am researching other Envers tasks, so no need
>> to rush with the decision.
>>
>> Regards,
>> Lukasz
>>
>> 2012/9/8 Hardy Ferentschik <hardy at hibernate.org>:
>>> Should have mentioned to look at Index, ClassInfo and
>>> AnnotationInstance to get a feel for the Jandex API. You find the
>>> Jandex project on Github - https://github.com/jbossas/jandex. I
>>> don't think there is a project website yet.
>>>
>>> --hardy
>>>
>>>
>>>
>>> On 7 Sep 2012, at 22:05, Łukasz Antoniak <lukasz.antoniak at gmail.com>
>>> wrote:
>>>
>>>> Hello Steve,
>>>>
>>>> Just wanted to let you know that I am trying to migrate Envers to new
>>>> metamodel. I have asked below question on IRC, but without any
>>>> response. At the moment Envers locates its annotations (for example
>>>> @Audited) using ReflectionManager. What would be the preferable way of
>>>> achieving this in metamodel branch? Shall I use
>>>> EntityBinding#getClassReference() method and standard reflection API?
>>>> Just a hint, please :).
>>>>
>>>> Regards,
>>>> Lukasz
>>>>
>>>> 2012/8/24 Steve Ebersole <steve at hibernate.org>:
>>>>> Lukasz, as always, any help you can give is appreciated!  Whenever
>>>>> you have
>>>>> time.  We have a temporary solution that will isolate needed
>>>>> changes to just
>>>>> Envers.  Basically the changes at some point will be using the
>>>>> JAXB binding
>>>>> model rather than DOM.
>>>>>
>>>>>
>>>>> On Fri 24 Aug 2012 01:55:55 AM CDT, Łukasz Antoniak wrote:
>>>>>>
>>>>>> Hello Steve,
>>>>>>
>>>>>> I think I could start working on metamodel branch at the
>>>>>> beginning of
>>>>>> September. Is it acceptable for you? I don't want to postpone 4.1.7
>>>>>> release. JIRA task has been already registered:
>>>>>> https://hibernate.onjira.com/browse/HHH-7490.
>>>>>>
>>>>>> Best Regards,
>>>>>> Lukasz
>>>>>>
>>>>>>
>>>>>> __________ Information from ESET NOD32 Antivirus, version of virus
>>>>>> signature database 7412 (20120823) __________
>>>>>>
>>>>>> The message was checked by ESET NOD32 Antivirus.
>>>>>>
>>>>>> http://www.eset.com
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> steve at hibernate.org
>>>>> http://hibernate.org
>>>>
>>>> _______________________________________________
>>>> hibernate-dev mailing list
>>>> hibernate-dev at lists.jboss.org
>>>> https://lists.jboss.org/mailman/listinfo/hibernate-dev
>>
>> _______________________________________________
>> hibernate-dev mailing list
>> hibernate-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/hibernate-dev
>>
>

--
steve at hibernate.org
http://hibernate.org


More information about the hibernate-dev mailing list