-->
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.  [ 2 posts ] 
Author Message
 Post subject: serialVersionUID and Eclipse warnings
PostPosted: Thu May 31, 2007 5:02 am 
Newbie

Joined: Wed May 30, 2007 10:34 pm
Posts: 3
Hibernate version: Hiberate Tools 3.2.0.beta9a

They're really annoying warnings, I take notice of my warnings, I don't want to switch off this warning in Eclipse, and the Eclipse warning filters are pants.

So, I added to my reveng.xml:

Code:
    <table name="MY_TABLE">
        <meta attribute="scope-class">@SuppressWarnings("serial") public</meta>
    </table>


and it works, in Java 5, but ... apart from not being pretty, I had to add it to every table individually, and even then it didn't fix the CompositeId classes.

So, then I read this: http://www.hibernate.org/70.html which suggested I could put this once, in a config.xml. But I couldn't get it to work.

Is there a good way to suppress these warnings from Hibernate generated classes?


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 31, 2007 6:24 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
set it in <table-filter> or simply update the *.ftl to include the @SuppressWarnings on all your classes.

but before doing these things (adding suppresswarnings is probably the best thing to do though) please learn what the warning is about, and that having the serialVersionUID is *only* relevant if you want to guarantee compabilitiy between different versions of the same class - that is not something most people do (they need to implement custom code on top of adding the id) and hence why we don't generate the serialversion id.

_________________
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.  [ 2 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.