RE: Cayenne-generated classes need @SuppressWarnings("serial")

2011-10-04 Thread Durchholz, Joachim
> The serialization process seems > to serialize the superclass state based on their own SerialVersionUIDs > -- that seems like the logical way to do it in any case as otherwise a > subclass would have to know the implementation details for all > superclasses. Ah. I agree, but can't easily verify

Re: Cayenne-generated classes need @SuppressWarnings("serial")

2011-10-04 Thread Mike Kienenberger
I wrote the wrong thing in my message. It should have been "generated superclass" rather than "generated subclass" -- hopefully it was still obvious we're talking about the generated class from the context. While it's true that SerialVersionUID is not useful for the subclass's serialization, as f

RE: Cayenne-generated classes need @SuppressWarnings("serial")

2011-10-04 Thread Durchholz, Joachim
> -- SerialVersionUID seems to matter on the generated subclass, > especially since this is where all of the state of CayenneDataObject > exists. But I can only infer this -- I cannot find a specific > statement. [1] [2] I can ;-) > [1] http://download.oracle.com/javase/1,5.0/docs/api/java/io/S

Re: Cayenne-generated classes need @SuppressWarnings("serial")

2011-10-04 Thread Mike Kienenberger
I am not an expert on serialization, and it's been a long time since I looked into it. By a strange coincidence, the only cayenne project I wrote involving serialization is the legacy Cayenne 1.2 app I am doing maintenance on this week, after having not touched it in four or more years. However,

RE: Cayenne-generated classes need @SuppressWarnings("serial")

2011-10-04 Thread Durchholz, Joachim
>> In that case, it may help to declare the generated classes abstract. >> Abstract classes cannot be deserialized, so the compiler should not complain. > > Oh and BTW, generated classes are abstract (at least in 3.1), and the > compiler still complains - separately about superclass and subclass

Re: Cayenne-generated classes need @SuppressWarnings("serial")

2011-10-04 Thread Andrus Adamchik
On Oct 4, 2011, at 12:48 PM, Durchholz, Joachim wrote: > In that case, it may help to declare the generated classes abstract. Abstract > classes cannot be deserialized, so the compiler should not complain. Oh and BTW, generated classes are abstract (at least in 3.1), and the compiler still com

Re: Cayenne-generated classes need @SuppressWarnings("serial")

2011-10-04 Thread Andrus Adamchik
FYI: we took this discussion to the dev list: http://markmail.org/message/hqtlopjmruxw6ty4 @SuppressWarnings is out of the picture now, but the rest is still up for discussion. Andrus On Oct 4, 2011, at 12:48 PM, Durchholz, Joachim wrote: > Are generated classes ever instantiated via new? > I

RE: Cayenne-generated classes need @SuppressWarnings("serial")

2011-10-04 Thread Durchholz, Joachim
Are generated classes ever instantiated via new? If not, SerialVersionUID does not serve any useful purpose, it's the programmer-written subclass that gets asked for the SerialVersionUID. In that case, it may help to declare the generated classes abstract. Abstract classes cannot be deserialized,

Re: Cayenne-generated classes need @SuppressWarnings("serial")

2011-10-03 Thread Bob Harner
Submitted -- https://issues.apache.org/jira/browse/CAY-1622 ("Generated classes shouldn't produce serialVersionUID compiler warning") On Mon, Oct 3, 2011 at 3:34 AM, Andrus Adamchik wrote: > Appreciate if someone could jira that. > > > On Oct 3, 2011, at 8:57 AM, Christian Grobmeier wrote: >

Re: Cayenne-generated classes need @SuppressWarnings("serial")

2011-10-03 Thread Andrus Adamchik
Appreciate if someone could jira that. On Oct 3, 2011, at 8:57 AM, Christian Grobmeier wrote: >>> The @SuppressWarnings("serial") annotation will get rid of the >>> warnings, but of course I don't want to manually update the generated >>> classes. > >> >> Yeah, that one kind of bothers me as w

Re: Cayenne-generated classes need @SuppressWarnings("serial")

2011-10-02 Thread Christian Grobmeier
>> The @SuppressWarnings("serial") annotation will get rid of the >> warnings, but of course I don't want to manually update the generated >> classes. > > Yeah, that one kind of bothers me as well. Why wouldn't you just generate a > default serial number? Or a random one? > Actually generating se

Re: Cayenne-generated classes need @SuppressWarnings("serial")

2011-10-02 Thread Richard Frovarp
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 a