Q:

What's the correct way for persistent storage of an inner class in GAE/J JDO?

From GAE's documentation, I can read this:

The entity's kind is derived from the simple name of the class (inner classes use the $ path without the package name). 

which does not tell me how to store it, and this:

Here is an example of an embedded class. This example makes the embedded class an inner class of the data class that uses it; this is useful, but not required to make a class embeddable.

Why is it useful? What is the advantage of making the class "embedded"? How would I proceed if I do not need to "embed" it? I'm having a hard time understanding this last statement.
Let's say I have this class:
@PersistenceCapable
public class ChatHistory {
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;

    @Persistent
    private ArrayList<Message> messages;
    // more fields and all the ChatHistory methods here

    private class Message implements Comparable<Message>{ // <-- This one
        public String timeStamp;
        public String text;
        // more fields and all the Message methods here
    }
}

How would you store it?

A:

The most obvious thing would be to make Message into a static class (the idea of trying to persist non-static classes makes my head hurt) and to annotate it with @PersistenceCapable. That will then cause it to be turned into its own table. You might be best advised to move it into its own file (and change it to 'package private') instead.

