This repository has been archived by the owner on Apr 12, 2018. It is now read-only.
forked from aboisvert/liftweb
-
Notifications
You must be signed in to change notification settings - Fork 57
/
Fixtures.scala
509 lines (424 loc) · 22.1 KB
/
Fixtures.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
/*
* Copyright 2010 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.liftweb {
package mongodb {
package record {
package fixtures {
import field._
import common.{Box, Empty, Failure, Full}
import json.JsonAST.JString
import json.ext.JsonBoxSerializer
import util.FieldError
import util.StringHelpers.randomString
import java.math.MathContext
import scala.xml.Text
import net.liftweb.record._
import net.liftweb.record.field._
object MyTestEnum extends Enumeration {
val ONE = Value("ONE")
val TWO = Value("TWO")
val THREE = Value("THREE")
}
trait HarnessedLifecycleCallbacks extends LifecycleCallbacks {
var beforeValidationHarness: () => Unit = () => ()
override def beforeValidation = beforeValidationHarness()
var afterValidationHarness: () => Unit = () => ()
override def afterValidation = afterValidationHarness()
var beforeSaveHarness: () => Unit = () => ()
override def beforeSave = beforeSaveHarness()
var beforeCreateHarness: () => Unit = () => ()
override def beforeCreate = beforeCreateHarness()
var beforeUpdateHarness: () => Unit = () => ()
override def beforeUpdate = beforeUpdateHarness()
var afterSaveHarness: () => Unit = () => ()
override def afterSave = afterSaveHarness()
var afterCreateHarness: () => Unit = () => ()
override def afterCreate = afterCreateHarness()
var afterUpdateHarness: () => Unit = () => ()
override def afterUpdate = afterUpdateHarness()
var beforeDeleteHarness: () => Unit = () => ()
override def beforeDelete = beforeDeleteHarness()
var afterDeleteHarness: () => Unit = () => ()
override def afterDelete = afterDeleteHarness()
}
class FieldTypeTestRecord private () extends MongoRecord[FieldTypeTestRecord] with ObjectIdPk[FieldTypeTestRecord] {
def meta = FieldTypeTestRecord
object mandatoryBooleanField extends BooleanField(this)
object legacyOptionalBooleanField extends BooleanField(this) { override def optional_? = true }
object optionalBooleanField extends OptionalBooleanField(this)
object mandatoryCountryField extends CountryField(this)
object legacyOptionalCountryField extends CountryField(this) { override def optional_? = true }
object optionalCountryField extends OptionalCountryField(this)
/*
object mandatoryDateTimeField extends DateTimeField(this)
object legacyOptionalDateTimeField extends DateTimeField(this) { override def optional_? = true }
object optionalDateTimeField extends OptionalDateTimeField(this)
*/
// Gets saved in MongoDB with toString
object mandatoryDecimalField extends DecimalField(this, MathContext.UNLIMITED, 2)
object legacyOptionalDecimalField extends DecimalField(this, MathContext.UNLIMITED, 2) { override def optional_? = true }
object optionalDecimalField extends OptionalDecimalField(this, MathContext.UNLIMITED, 2)
object mandatoryDoubleField extends DoubleField(this)
object legacyOptionalDoubleField extends DoubleField(this) { override def optional_? = true }
object optionalDoubleField extends OptionalDoubleField(this)
object mandatoryEmailField extends EmailField(this, 100)
object legacyOptionalEmailField extends EmailField(this, 100) { override def optional_? = true }
object optionalEmailField extends OptionalEmailField(this, 100)
object mandatoryEnumField extends EnumField(this, MyTestEnum)
object legacyOptionalEnumField extends EnumField(this, MyTestEnum) { override def optional_? = true }
object optionalEnumField extends OptionalEnumField(this, MyTestEnum)
object mandatoryIntField extends IntField(this)
object legacyOptionalIntField extends IntField(this) { override def optional_? = true }
object optionalIntField extends OptionalIntField(this)
object mandatoryLocaleField extends LocaleField(this)
object legacyOptionalLocaleField extends LocaleField(this) { override def optional_? = true }
object optionalLocaleField extends OptionalLocaleField(this)
object mandatoryLongField extends LongField(this)
object legacyOptionalLongField extends LongField(this) { override def optional_? = true }
object optionalLongField extends OptionalLongField(this)
object mandatoryPostalCodeField extends PostalCodeField(this, mandatoryCountryField)
object legacyOptionalPostalCodeField extends PostalCodeField(this, mandatoryCountryField) { override def optional_? = true }
object optionalPostalCodeField extends OptionalPostalCodeField(this, mandatoryCountryField)
object mandatoryStringField extends StringField(this, 100)
object legacyOptionalStringField extends StringField(this, 100) { override def optional_? = true }
object optionalStringField extends OptionalStringField(this, 100)
object mandatoryTextareaField extends TextareaField(this, 100)
object legacyOptionalTextareaField extends TextareaField(this, 100) { override def optional_? = true }
object optionalTextareaField extends OptionalTextareaField(this, 100)
object mandatoryTimeZoneField extends TimeZoneField(this)
object legacyOptionalTimeZoneField extends TimeZoneField(this) { override def optional_? = true }
object optionalTimeZoneField extends OptionalTimeZoneField(this)
override def equals(other: Any): Boolean = other match {
case that:FieldTypeTestRecord =>
this.id.value == that.id.value &&
this.mandatoryBooleanField.value == that.mandatoryBooleanField.value &&
this.legacyOptionalBooleanField.valueBox == that.legacyOptionalBooleanField.valueBox &&
this.optionalBooleanField.value == that.optionalBooleanField.value &&
this.mandatoryCountryField.value == that.mandatoryCountryField.value &&
this.legacyOptionalCountryField.value == that.legacyOptionalCountryField.value &&
this.optionalCountryField.value == that.optionalCountryField.value &&
this.mandatoryDecimalField.value == that.mandatoryDecimalField.value &&
this.legacyOptionalDecimalField.value == that.legacyOptionalDecimalField.value &&
this.optionalDecimalField.value == that.optionalDecimalField.value &&
this.mandatoryDoubleField.value == that.mandatoryDoubleField.value &&
this.legacyOptionalDoubleField.value == that.legacyOptionalDoubleField.value &&
this.optionalDoubleField.value == that.optionalDoubleField.value &&
this.mandatoryEmailField.value == that.mandatoryEmailField.value &&
this.legacyOptionalEmailField.value == that.legacyOptionalEmailField.value &&
this.optionalEmailField.value == that.optionalEmailField.value &&
this.mandatoryEnumField.value == that.mandatoryEnumField.value &&
this.legacyOptionalEnumField.value == that.legacyOptionalEnumField.value &&
this.optionalEnumField.value == that.optionalEnumField.value &&
this.mandatoryIntField.value == that.mandatoryIntField.value &&
this.legacyOptionalIntField.value == that.legacyOptionalIntField.value &&
this.optionalIntField.value == that.optionalIntField.value &&
this.mandatoryLocaleField.value == that.mandatoryLocaleField.value &&
this.legacyOptionalLocaleField.value == that.legacyOptionalLocaleField.value &&
this.optionalLocaleField.value == that.optionalLocaleField.value &&
this.mandatoryLongField.value == that.mandatoryLongField.value &&
this.legacyOptionalLongField.value == that.legacyOptionalLongField.value &&
this.optionalLongField.value == that.optionalLongField.value &&
this.mandatoryPostalCodeField.value == that.mandatoryPostalCodeField.value &&
this.legacyOptionalPostalCodeField.value == that.legacyOptionalPostalCodeField.value &&
this.optionalPostalCodeField.value == that.optionalPostalCodeField.value &&
this.mandatoryStringField.value == that.mandatoryStringField.value &&
this.legacyOptionalStringField.value == that.legacyOptionalStringField.value &&
this.optionalStringField.value == that.optionalStringField.value &&
this.mandatoryTextareaField.value == that.mandatoryTextareaField.value &&
this.legacyOptionalTextareaField.value == that.legacyOptionalTextareaField.value &&
this.optionalTextareaField.value == that.optionalTextareaField.value &&
this.mandatoryTimeZoneField.value == that.mandatoryTimeZoneField.value &&
this.legacyOptionalTimeZoneField.value == that.legacyOptionalTimeZoneField.value &&
this.optionalTimeZoneField.value == that.optionalTimeZoneField.value
case _ => false
}
}
object FieldTypeTestRecord extends FieldTypeTestRecord with MongoMetaRecord[FieldTypeTestRecord] {
override def formats = allFormats
}
class BinaryFieldTestRecord extends MongoRecord[BinaryFieldTestRecord] with IntPk[BinaryFieldTestRecord] {
def meta = BinaryFieldTestRecord
object mandatoryBinaryField extends BinaryField(this) {
// compare the elements of the Array
override def equals(other: Any): Boolean = other match {
case that: BinaryField[Any] =>
this.value.zip(that.value).filter(t => t._1 != t._2).length == 0
case _ => false
}
}
object legacyOptionalBinaryField extends BinaryField(this) {
override def optional_? = true
// compare the elements of the Array
override def equals(other: Any): Boolean = other match {
case that: BinaryField[Any] => (this.valueBox, that.valueBox) match {
case (Empty, Empty) => true
case (Full(a), Full(b)) =>
a.zip(b).filter(t => t._1 != t._2).length == 0
case _ => false
}
case _ => false
}
}
object optionalBinaryField extends OptionalBinaryField(this) {
// compare the elements of the Array
override def equals(other: Any): Boolean = other match {
case that: OptionalBinaryField[Any] => (this.valueBox, that.valueBox) match {
case (Empty, Empty) => true
case (Full(a), Full(b)) =>
a.zip(b).filter(t => t._1 != t._2).length == 0
case _ => false
}
case _ => false
}
}
override def equals(other: Any): Boolean = other match {
case that:BinaryFieldTestRecord =>
this.id.value == that.id.value &&
this.mandatoryBinaryField == that.mandatoryBinaryField &&
this.legacyOptionalBinaryField == that.legacyOptionalBinaryField &&
this.optionalBinaryField == that.optionalBinaryField
case _ => false
}
}
object BinaryFieldTestRecord extends BinaryFieldTestRecord with MongoMetaRecord[BinaryFieldTestRecord]
case class TypeTestJsonObject(
intField: Int,
stringField: String
) extends JsonObject[TypeTestJsonObject]
{
// TODO: Add more types
def meta = TypeTestJsonObject
}
object TypeTestJsonObject extends JsonObjectMeta[TypeTestJsonObject]
class MongoFieldTypeTestRecord private () extends MongoRecord[MongoFieldTypeTestRecord] with ObjectIdPk[MongoFieldTypeTestRecord] {
def meta = MongoFieldTypeTestRecord
object mandatoryDateField extends DateField(this)
object legacyOptionalDateField extends DateField(this) { override def optional_? = true }
object mandatoryJsonObjectField extends JsonObjectField(this, TypeTestJsonObject) {
def defaultValue = TypeTestJsonObject(0, "")
}
object legacyOptionalJsonObjectField extends JsonObjectField(this, TypeTestJsonObject) {
override def optional_? = true
def defaultValue = TypeTestJsonObject(0, "")
}
object mandatoryObjectIdField extends ObjectIdField(this)
object legacyOptionalObjectIdField extends ObjectIdField(this) { override def optional_? = true }
object mandatoryPatternField extends PatternField(this)
object legacyOptionalPatternField extends PatternField(this) { override def optional_? = true }
object mandatoryUUIDField extends UUIDField(this)
object legacyOptionalUUIDField extends UUIDField(this) { override def optional_? = true }
override def equals(other: Any): Boolean = other match {
case that:MongoFieldTypeTestRecord =>
this.id.value == that.id.value &&
this.mandatoryDateField.value == that.mandatoryDateField.value &&
this.mandatoryJsonObjectField.value == that.mandatoryJsonObjectField.value &&
this.mandatoryObjectIdField.value == that.mandatoryObjectIdField.value &&
this.mandatoryPatternField.value.pattern == that.mandatoryPatternField.value.pattern &&
this.mandatoryPatternField.value.flags == that.mandatoryPatternField.value.flags &&
this.mandatoryUUIDField.value == that.mandatoryUUIDField.value
case _ => false
}
}
object MongoFieldTypeTestRecord extends MongoFieldTypeTestRecord with MongoMetaRecord[MongoFieldTypeTestRecord] {
override def formats = allFormats
}
class PasswordTestRecord private () extends MongoRecord[PasswordTestRecord] with ObjectIdPk[PasswordTestRecord] {
def meta = PasswordTestRecord
object password extends MongoPasswordField(this, 3)
}
object PasswordTestRecord extends PasswordTestRecord with MongoMetaRecord[PasswordTestRecord]
class ListTestRecord private () extends MongoRecord[ListTestRecord] with UUIDPk[ListTestRecord] {
def meta = ListTestRecord
object mandatoryStringListField extends MongoListField[ListTestRecord, String](this)
object legacyOptionalStringListField extends MongoListField[ListTestRecord, String](this) { override def optional_? = true }
object mandatoryIntListField extends MongoListField[ListTestRecord, Int](this)
object legacyOptionalIntListField extends MongoListField[ListTestRecord, Int](this) { override def optional_? = true }
object mandatoryMongoJsonObjectListField extends MongoJsonObjectListField(this, TypeTestJsonObject)
object legacyOptionalMongoJsonObjectListField extends MongoJsonObjectListField(this, TypeTestJsonObject) { override def optional_? = true }
object mandatoryMongoSubRecordListField extends MongoSubRecordListField(this, SubRecord) {
// compare the elements of the List
override def equals(other: Any): Boolean = other match {
case that: MongoSubRecordListField[Any, Any] =>
this.value.zip(that.value).filter(t => t._1 != t._2).length == 0
case _ => false
}
}
object legacyOptionalMongoSubRecordListField extends MongoSubRecordListField(this, SubRecord) {
override def optional_? = true
}
// TODO: More List types
override def equals(other: Any): Boolean = other match {
case that:ListTestRecord =>
this.id.value == that.id.value &&
this.mandatoryStringListField.value == that.mandatoryStringListField.value &&
this.mandatoryIntListField.value == that.mandatoryIntListField.value &&
this.mandatoryMongoJsonObjectListField.value == that.mandatoryMongoJsonObjectListField.value &&
this.mandatoryMongoSubRecordListField == that.mandatoryMongoSubRecordListField
case _ => false
}
}
object ListTestRecord extends ListTestRecord with MongoMetaRecord[ListTestRecord] {
override def formats = allFormats
}
class MapTestRecord extends MongoRecord[MapTestRecord] with StringPk[MapTestRecord] {
def meta = MapTestRecord
override def defaultIdValue = randomString(12)
object mandatoryStringMapField extends MongoMapField[MapTestRecord, String](this)
object legacyOptionalStringMapField extends MongoMapField[MapTestRecord, String](this) { override def optional_? = true }
object mandatoryIntMapField extends MongoMapField[MapTestRecord, Int](this)
object legacyOptionalIntMapField extends MongoMapField[MapTestRecord, Int](this) { override def optional_? = true }
// TODO: More Map types, including JsonObject (will require a new Field type)
override def equals(other: Any): Boolean = other match {
case that:MapTestRecord =>
this.id.value == that.id.value &&
this.mandatoryStringMapField.value == that.mandatoryStringMapField.value &&
this.mandatoryIntMapField.value == that.mandatoryIntMapField.value
case _ => false
}
}
object MapTestRecord extends MapTestRecord with MongoMetaRecord[MapTestRecord] {
override def formats = allFormats
}
/*
* SubRecord fields
*/
class SubRecord extends MongoRecord[SubRecord] with MongoEmbed {
def meta = SubRecord
object name extends StringField(this, 12)
override def equals(other: Any): Boolean = other match {
case that:SubRecord =>
this.name.value == that.name.value
case _ => false
}
}
object SubRecord extends SubRecord with MongoMetaRecord[SubRecord] {
override def formats = allFormats
}
class SubRecordTestRecord extends MongoRecord[SubRecordTestRecord] with LongPk[SubRecordTestRecord] {
def meta = SubRecordTestRecord
object mandatoryMongoSubRecordField extends MongoSubRecordField(this, SubRecord)
object legacyOptionalMongoSubRecordField extends MongoSubRecordField(this, SubRecord) {
override def optional_? = true
}
object mandatoryFieldTypeMongoSubRecordField extends MongoSubRecordField(this, FieldTypeTestRecord)
object legacyOptionalFieldTypeMongoSubRecordField extends MongoSubRecordField(this, FieldTypeTestRecord) {
override def optional_? = true
}
object mandatoryMongoFieldTypeMongoSubRecordField extends MongoSubRecordField(this, MongoFieldTypeTestRecord)
object legacyMongoFieldTypeMongoSubRecordField extends MongoSubRecordField(this, MongoFieldTypeTestRecord) {
override def optional_? = true
}
override def equals(other: Any): Boolean = other match {
case that:SubRecordTestRecord =>
this.id.value == that.id.value &&
this.mandatoryMongoSubRecordField.value == that.mandatoryMongoSubRecordField.value &&
this.legacyOptionalMongoSubRecordField.valueBox == that.legacyOptionalMongoSubRecordField.valueBox &&
this.mandatoryFieldTypeMongoSubRecordField.value == that.mandatoryFieldTypeMongoSubRecordField.value &&
this.legacyOptionalFieldTypeMongoSubRecordField.valueBox == that.legacyOptionalFieldTypeMongoSubRecordField.valueBox &&
this.mandatoryMongoFieldTypeMongoSubRecordField.value == that.mandatoryMongoFieldTypeMongoSubRecordField.value &&
this.legacyMongoFieldTypeMongoSubRecordField.valueBox == that.legacyMongoFieldTypeMongoSubRecordField.valueBox
case _ => false
}
}
object SubRecordTestRecord extends SubRecordTestRecord with MongoMetaRecord[SubRecordTestRecord] {
override def formats = allFormats
}
/*
* MongoRefField
*/
class MongoRefTestRecord extends MongoRecord[MongoRefTestRecord] with ObjectIdPk[MongoRefTestRecord] {
def meta = MongoRefTestRecord
object mandatoryObjectIdRefField extends ObjectIdRefField(this, FieldTypeTestRecord)
object legacyOptionalObjectIdRefField extends ObjectIdRefField(this, FieldTypeTestRecord) {
override def optional_? = true
}
object mandatoryUUIDRefField extends UUIDRefField(this, ListTestRecord)
object legacyOptionalUUIDRefField extends UUIDRefField(this, ListTestRecord) {
override def optional_? = true
}
}
object MongoRefTestRecord extends MongoRefTestRecord with MongoMetaRecord[MongoRefTestRecord] {
override def formats = allFormats
}
/*
* Legacy DBRefField and MongoId test Record
*/
class RefRecord private () extends MongoRecord[RefRecord] with MongoId[RefRecord] {
def meta = RefRecord
}
object RefRecord extends RefRecord with MongoMetaRecord[RefRecord]
class DBRefTestRecord extends MongoRecord[DBRefTestRecord] with MongoId[DBRefTestRecord] {
def meta = DBRefTestRecord
object mandatoryDBRefField extends DBRefField[DBRefTestRecord, RefRecord](this, RefRecord)
object legacyOptionalDBRefField extends DBRefField[DBRefTestRecord, RefRecord](this, RefRecord) { override def optional_? = true }
override def equals(other: Any): Boolean = other match {
case that:DBRefTestRecord =>
this._id.value == that._id.value &&
this.mandatoryDBRefField.value.getId == that.mandatoryDBRefField.value.getId &&
this.mandatoryDBRefField.value.getRef == that.mandatoryDBRefField.value.getRef
case _ => false
}
}
object DBRefTestRecord extends DBRefTestRecord with MongoMetaRecord[DBRefTestRecord]
class LifecycleTestRecord private ()
extends MongoRecord[LifecycleTestRecord]
with MongoId[LifecycleTestRecord]
with HarnessedLifecycleCallbacks
{
def meta = LifecycleTestRecord
def foreachCallback(f: LifecycleCallbacks => Any): Unit =
meta.foreachCallback(this, f)
object innerObjectWithCallbacks extends LifecycleCallbacks with HarnessedLifecycleCallbacks
object stringFieldWithCallbacks extends StringField(this, 100) with LifecycleCallbacks with HarnessedLifecycleCallbacks
}
object LifecycleTestRecord extends LifecycleTestRecord with MongoMetaRecord[LifecycleTestRecord] {
// without this, the Scala 2.7 compiler panics, so don't blame me if you remove it and it's confusing!
override def foreachCallback(inst: LifecycleTestRecord, f: LifecycleCallbacks => Any) = super.foreachCallback(inst, f)
}
case class JsonObj(id: String, name: String) extends JsonObject[JsonObj] {
def meta = JsonObj
}
object JsonObj extends JsonObjectMeta[JsonObj]
class NullTestRecord extends MongoRecord[NullTestRecord] with IntPk[NullTestRecord] {
def meta = NullTestRecord
object nullstring extends StringField(this, 32) {
override def optional_? = true
}
object jsonobj extends JsonObjectField[NullTestRecord, JsonObj](this, JsonObj) {
def defaultValue = JsonObj("1", null)
}
object jsonobjlist extends MongoJsonObjectListField[NullTestRecord, JsonObj](this, JsonObj)
}
object NullTestRecord extends NullTestRecord with MongoMetaRecord[NullTestRecord]
case class BoxTestJsonObj(id: String, boxEmpty: Box[String], boxFull: Box[String], boxFail: Box[String])
extends JsonObject[BoxTestJsonObj] {
def meta = BoxTestJsonObj
}
object BoxTestJsonObj extends JsonObjectMeta[BoxTestJsonObj]
class BoxTestRecord extends MongoRecord[BoxTestRecord] with LongPk[BoxTestRecord] {
def meta = BoxTestRecord
object jsonobj extends JsonObjectField[BoxTestRecord, BoxTestJsonObj](this, BoxTestJsonObj) {
def defaultValue = BoxTestJsonObj("0", Empty, Full("Full String"), Failure("Failure"))
}
object jsonobjlist extends MongoJsonObjectListField[BoxTestRecord, BoxTestJsonObj](this, BoxTestJsonObj)
}
object BoxTestRecord extends BoxTestRecord with MongoMetaRecord[BoxTestRecord] {
override def formats = super.formats + new JsonBoxSerializer
}
}
}
}
}