-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: hbm2java adding annotations
PostPosted: Fri Oct 26, 2007 8:56 am 
Newbie

Joined: Tue Jul 26, 2005 11:08 am
Posts: 2
Hibernate version:
3.2.2

I would like to use a meta element to add some an annotation to some get methods.

Is this supported yet in hbm2java or am I going to have to write a patch?

There is a bug here:
http://opensource.atlassian.com/project ... se/HBX-713
which talks about adding annotations at the class level.

In this case I want to add @Auditable annotations to my get methods.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 26, 2007 8:57 am 
Newbie

Joined: Tue Jul 26, 2005 11:08 am
Posts: 2
Just a quick extension with an example. I wish to be able to do:

<property name="name" column="name" type="string">
<meta attribute="get-method-annotation">@Auditable</meta>
</property>

Which will generate:

@Auditable
public String getName() {
return name;
}


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 28, 2007 3:42 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
No this haven't been done, and i'm not sure if it is really a good idea ...where do stop - when is the hbm.xml more code than mappings?

Note: if you put up a patch i will consider it - especially if you have good usecase ,)

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.