[hibernate-issues] [Hibernate-JIRA] Issue Comment Edited: (METAGEN-7) Try to find a way to be able to use @SupportedAnnotationTypes("javax.persistence.Entity") in JPAMetaModelEntityProcessor

Hardy Ferentschik (JIRA) noreply at atlassian.com
Fri Oct 1 10:18:57 EDT 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/METAGEN-7?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=38590#action_38590 ] 

Hardy Ferentschik edited comment on METAGEN-7 at 10/1/10 9:18 AM:
------------------------------------------------------------------

Yes, {{init()}} is called all the time, but how do in init whether the processing has to end and I have to write the metamodel classes from {{init()}} instead of {{process}}. There is no equivalent to {{roundEnvironment.processingOver()}}.
Anyways, I decided to rely in meta data information in xml. If you only have XML configuration you need to specify 
{code}
<persistence-unit-metadata>
   <xml-mapping-metadata-complete/>
</persistence-unit-metadata>
{code}
in one of your mapping files. I think that's a reasonable assumption.

      was (Author: hardy.ferentschik):
    Yes, {{init()}} is called all the time, but how do in init whether the processing has to end and I have to write the metamodel classes from {{init()}} instead of {{process}}. There is no equivalent to {{roundEnvironment.processingOver()}}.
Anyways, I decided to rely in meta data information in xml. If you only have XML configuration you need to specify 
{code}
    <persistence-unit-metadata>
        <xml-mapping-metadata-complete/>
    </persistence-unit-metadata>
{code}
in one of your mapping files. I think that's a reasonable assumption.
  
> Try to find a way to be able to use @SupportedAnnotationTypes("javax.persistence.Entity") in JPAMetaModelEntityProcessor
> ------------------------------------------------------------------------------------------------------------------------
>
>                 Key: METAGEN-7
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/METAGEN-7
>             Project: Hibernate Metamodel Generator
>          Issue Type: Task
>          Components: processor
>    Affects Versions: 1.0.0-Beta-2
>            Reporter: Hardy Ferentschik
>            Assignee: Hardy Ferentschik
>             Fix For: 1.1.0
>
>
> At the moment we use @SupportedAnnotationTypes("*"). Better would be to explicitly specify  @SupportedAnnotationTypes("javax.persistence.Entity"). Then the processor would only be called if there are any entities annotated with @Entity. However, this also means that the processor is not getting called at all if there is no @Entity which could be the case if all configuration is done via xml. 
> We would need a way to make sure that the processor is called at least once to ensure xml is parsed. Other than that only entities annotated with @Entity should be passed to the processor. 
> At the moment I don't see how we can make this happen :(

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list