Problem with registerCaseObjectOverride - updates getting overwritten with an unwanted _typeHint

20 views
Skip to first unread message

Jonny Cavell

unread,
May 20, 2014, 7:25:56 AM5/20/14
to scala...@googlegroups.com
Hi 

I have to admit I don't really like _typeHint because of the associated problems with refactoring / schema migration.

Therefore I want to use registerCaseObjectOverride so that Case Objects are serialised with a String representation.

This works fine when I insert a document, but when I subsequently try an update the default _typeHint magically replaces my String representation

E.g. if I have a Case Object called Thingy1 which is correctly inserted with the String THINGY_1 but then update it to Thingy2 e.g., calling updateById(mongoId, $set("application.myThingy" -> grater[MyThingy].asDBObject(thingy2)) will result in myThingy being stored e.g. as {"_typeHint": "com.xxx.Thingy2$"} rather than simply "THINGY_2"

This means I can't use registerCaseObjectOverride

I'm using salat-core_2.10-1.9.2

Thanks

Jonny

rktoomey

unread,
May 20, 2014, 8:33:36 AM5/20/14
to scala...@googlegroups.com
Hi Jonny,

sorry about that bug - the workaround is to not use grater[MyThingy].asDBObject but to simply use myThingy.label instead.

I will try to reproduce your issue and fix it in 1.9.9-SNAPSHOT.

Best,
Rose

Jonny Cavell

unread,
May 20, 2014, 12:55:27 PM5/20/14
to scala...@googlegroups.com
Thanks for the reply. That workaround works fine.

Jonny
Reply all
Reply to author
Forward
0 new messages