cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob Harner <bobhar...@gmail.com>
Subject Cayenne-generated classes need @SuppressWarnings("serial")
Date Sun, 02 Oct 2011 21:47:17 GMT
Hi everybody,

Here's a noob question that has probably been asked before, but I
didn't see any answers that I liked...

I prefer to keep all compiler warnings in my code to a minimum. One of
the very few things that I don't like about Cayenne is that the
auto-generated entity classes always have the "The serializable class
_Foo does not declare a static final serialVersionUID field of type
long" compiler warning.

I suppose *not* defining a serialVersionUID (and letting the compiler
do it automatically) is the best choice for common Cayenne use cases,
so it'd be nice to just suppress the warning.

The @SuppressWarnings("serial") annotation will get rid of the
warnings, but of course I don't want to manually update the generated
classes.

I could configure my IDE to ignore these warnings (yuk), but then
other team members will still see them.

I guess I could set up a custom velocity template to include this
annotation, right?

But my real question is: why doesn't Cayenne's default template
already add this @SuppressWarnings("serial") annotation? Is it simply
that none of the Cayenne developers happen to feel as I do that code
(especially library code) should not produce compiler warnings?

Anyway, thanks for a great framework!

Mime
View raw message