My 2c on annotation overriding.

Posted by    |      

Cedric and Bill have proposed solutions. My preference is basically similar to Bill's, but here's how I would write it:

<class name="org.hibernate.Item">
    @Entity
    @Table(name="AUCTION_ITEM")
    <method sig="getBar()">@Transient</method>
    <method sig="doSomething(int, String)">
        @Tx(REQUIRES_NEW)
    </method>
</class>

I like this, because the same approach can be used outside of the context of J2EE. I /really/ wish something like this would have been included in JSR-175.


Back to top