morphia icon indicating copy to clipboard operation
morphia copied to clipboard

Warnings while querying reference fields with a key

Open ismetozalp opened this issue 13 years ago • 7 comments

Hi! I come to found a warning when i query reference fields with Key. I don't think it's necessary. But if it is, Is there way to suppress this warning. Let me explain the situation

I have a object

@Entity(noClassnameStored = true) public class CrewLabel implements IsSerializable {

@Id public ObjectId id;

@Reference public Employee owner; }

When i try to query it like this

Query query = createQuery(); query.field("owner").equal(new Key(Employee.class, ownerId));

I got the warning

WARNING: The type(s) for the query/update may be inconsistent; using an instance of type 'com.github.jmkgreen.morphia.Key' for the field 'com.statu.alarga.web.shared.model.CrewLabel.owner' which is declared as 's.model.Employee' --@--com.statu.alarga.web.server.dao.CrewLabelDaoImpl.findLabelsOfCrew(CrewLabelDaoImpl.java:72)

What can we do about this?

Thank you.

Regards, Ismet

[ pulled from https://github.com/jmkgreen/morphia/issues/65 ]

ismetozalp avatar Jul 05 '13 12:07 ismetozalp

How do i vote for this one? Its driving me nuts and filling up my logs with crap.

bpappin avatar Aug 28 '13 04:08 bpappin

You can star the issue, its on the header. But i dont think they are going to fix it soon, since there more important issues.

ismetozalp avatar Aug 28 '13 20:08 ismetozalp

I'm guessing your right based on the age of this problem, its extremely annoying since its a simply change and causes a lot of trouble in a running system.

bpappin avatar Aug 28 '13 20:08 bpappin

I have some largerish issues to resolve in the next release but I'll take a look at this one, too. I was just looking at a similar issue today, actually.

evanchooly avatar Aug 28 '13 21:08 evanchooly

Any idea which version this will make it into?

bpappin avatar Nov 20 '13 22:11 bpappin

0.106

evanchooly avatar Nov 20 '13 22:11 evanchooly

hi did this ever get resolved,im trying to do the same thing,

lahong avatar Apr 01 '17 09:04 lahong