-->
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: implement an interface
PostPosted: Tue Aug 02, 2005 11:22 am 
Beginner
Beginner

Joined: Sun Aug 22, 2004 5:32 pm
Posts: 40
Is it possible to setup a mapping file so the generated class implements a specified interface?

The person who wrote the code I am currently working on created some mapping files, then edited the generated classes by adding "implements interface xxxx" in each file. This is a major pain when I regenerate the code. I have to edit every single file by hand.

Thanks.

_________________
Scott
www.HikeHaven.com


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 02, 2005 2:50 pm 
Newbie

Joined: Tue Aug 02, 2005 2:34 pm
Posts: 2
You can specify a meta attribute in your mapping file.

Code:
<class name="Xyz" table="XYZ">
   <meta attribute="implements">XyzInterface</meta>
   ...


Alternately, if you need to put this same interface reference in every mapping, you can drop it into your generation configuration file (generate.config.xml).

Code:
<codegen>
   <meta attribute="implements">XyzInterface</meta>
   <meta attribute="implement-equals">true</meta>
</codegen>


Check Chapter 15: http://www.hibernate.org/hib_docs/reference/en/html/toolsetguide.html


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 02, 2005 4:18 pm 
Beginner
Beginner

Joined: Sun Aug 22, 2004 5:32 pm
Posts: 40
This works great. Thanks.

_________________
Scott
www.HikeHaven.com


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.