jodyyangyh / mongo-java-orm

Automatically exported from code.google.com/p/mongo-java-orm
1 stars 0 forks source link

@Id with autogenerate set to true should barf if applied to something incompatible with autogeneration #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
One common mistake I have when setting up object mappings w/non-ObjectID types 
that map to something other than ObjectID is forgetting that auto-generation 
defaults to true:

public class Foo {
  @Id
  @Property
  public ComplexIdType blah() {
  }
}

It would be nice if there was a friendly error message either at generation or 
mapping time that indicated that I should turn off auto-generation for this @Id 
mapping. The current error message is basically that it can't map something to 
ObjectID.

Original issue reported on code.google.com by mmast...@gmail.com on 10 Apr 2013 at 9:07