On 10/2/2011 4:47 PM, Bob Harner wrote:
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!
Yeah, that one kind of bothers me as well. Why wouldn't you just generate a default serial number? Or a random one?
