Issue 296 in morphia: Validation should not warn for Key<T>/DBRefs

3 views
Skip to first unread message

mor...@googlecode.com

unread,
Jul 6, 2011, 12:06:49 PM7/6/11
to morphia...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Low

New issue 296 by suman...@gmail.com: Validation should not warn for
Key<T>/DBRefs
http://code.google.com/p/morphia/issues/detail?id=296

Morphia - 1.00-SNAPSHOT
Mongo - mongodb-linux-x86_64-1.6.4
mongo-java-driver - 2.6

Given:

@Entity
Class A {
@Id
ObjectId id

String name
@Reference
B b
}

@Entity
Class B {
@Id
ObjectId id
}

Running:

Iterable<A> as = ds.find(A.class, "name", "MorphiaRules").filter("b",
new Key<B>(B.class, id)).fetch()

Results in the following warning:

WARNING: The type(s) for the query/update may be inconsistent; using an
instance of type 'com.google.code.morphia.Key' for the field 'A.b' which is
declared as 'B'

mor...@googlecode.com

unread,
May 8, 2012, 11:48:55 AM5/8/12
to morphia...@googlegroups.com

Comment #1 on issue 296 by philipp....@edistream.com: Validation should not
You can suppress the log message if you use .disableValidation() in your
query.
IMHO the logging should ignore this (perfectly valid) query even if
validation is activated.

mor...@googlecode.com

unread,
Aug 16, 2013, 1:30:51 AM8/16/13
to morphia...@googlegroups.com

Comment #2 on issue 296 by bpap...@sixgreen.com: Validation should not warn
Disabling validation is *not* a solution.
The code knows what to do in this situation and it works properly, ergo the
warning should not be printed.

+1 for me.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
Reply all
Reply to author
Forward
0 new messages