hi, how to force Query references with Eager?
:) sorry about my bad English
For more information:
http://code.google.com/p/morphia/wiki/Query
Let's say I want to use the fluent interface to find which {{{Person}}}s
have an {{{Address}}} is equal to {{{addr}}}:
{{{Query<Person> =
ds.createQuery(Person.class).field("address").equal(addr);}}}
How is equality determined? Is Morphia essentially confirming that
{{{addr.id}}} equals {{{Person.address.id}}}? This would imply that you
can't query for equality against an object that has not been saved the db -
is this correct? Thanks!
jm..., It will compare all the fields. If you just want to match on a
single field, then use that field (using dot-notation).
goudreau: do you mean like a regular expression?
It is best to ask questions on the group/list, please follow up there.
There is support for limit; I will add some docs.
(condition_A1 && condition_A2 && condition_A3) || (condition_B1 &&
condition_B2 && condition_B3) || (condition_C1 && condition_C2 &&
condition_C3)
how to use query to do?
I've got the same problem. How to use query to do:
(condition_A1 || condition_A2 || condition_A3)
&& (condition_B1 || condition_B2 || condition_B3)
&& (condition_C1 || condition_C2 || condition_C3)
Thanks in advance
How to include more than one fields in the returned data with
retrievedFields???
I mean you do query.retrievedFields(true,"field,field"); ?
Yes, a comma sep. list is the way.
Thanks for the quick response. I don't know what i am doing wrong here?
I have a DAO to access the database.
My code id :
{{{
Query<Venue> temp = createQuery();
List<Venue> venues = temp.retrievedFields(false, "photos, Lat, Lng")....
}}}
But it return "The field 'photos, Lat, Lng' could not be found " but i have
declared them???
Hi, i resolved my problem with a workaround i don't know if it is a bug or
not but it worked for me.
{{{
String _f = "photos,Lat,Lng";
String [] fields = _f.split(",");
temp = temp.retrievedFields(false, fields);
}}}
The second parameter must be an array of strings. I think that this could
be done inside the retrievedFields functions.
Yes, the last arg is a var arg, or String[]. I updated the docs; sorry for
the mistake.
hi I want to search in a map type field. For example:
p <contry,city>
q.field(p).hasAnyOf("Istanbul");
how can I do that?
ps: it's not working of course.
It would be nice if we could query type safe, e.g. make sure the field foo
actually exists in MyEntity.class and that operations are compatible with
this type. This probably involve some code generetion to generate a class
like 'MyEntityField' that has a field FOO and legitimate operations.
Some one can write:
ds.createQuery(MyEntity.class).filter(MyEntityField.FOO.lessThan(12)).offset(1000);
instead of:
ds.createQuery(MyEntity.class).filter("foo >", 12).offset(1000);
Any thoughts on this?
It would be nice if we could query type safe, e.g. make sure the field foo
actually exists in `MyEntity.class` and that operations are compatible with
this type. This will probably involve some code generetion to generate a
@Myself,
QueryDSL has a mongodb plugin that works with morphia:
http://www.querydsl.com/static/querydsl/2.1.0/reference/html/ch02s07.html
I have Query that is executed without changes multiple times. Can I make
Query as a static field? in other word is Query thread-safe?