google-code-export / morphia

Automatically exported from code.google.com/p/morphia
1 stars 0 forks source link

please support @NotSaved annotation for nested classes #397

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am guessing that the error I reported (Issue 396), raised by
"fields stored in the db can't have . in them" is caused by my
trying to declare a nested class.

I tried to fix this with a @NotSaved annotation, but Eclipse gives
me an error: "The annotation @NotSaved is disallowed for this location"

Could you please support @NotSaved annotation for nested classes?

@Entity("widgets")
public class Widget {
    @Id
    private ObjectId id;

    @NotSaved
    public static class WidgetParams  {

        }
}

What version are you using? (Morphia/Driver/MongoDB)
morphia version 0.99
mongodb version v1.8.1

Please include a stack trace below:

Original issue reported on code.google.com by ostraz on 25 Mar 2012 at 4:06

GoogleCodeExporter commented 9 years ago
This annotation is for fields, not classes. The static class has nothing to do 
with what gets persisted.

Please provide a real example to indicate the issue. This example could not 
cause that exception.

Original comment by scotthernandez on 25 Mar 2012 at 4:20

GoogleCodeExporter commented 9 years ago
Yes, you are right, this was a field, not a class. Sorry for the trouble.

Original comment by ostraz on 25 Mar 2012 at 8:43