@@ -256,6 +256,121 @@ class OneToManyTest(
256
256
}
257
257
}
258
258
259
+ @Test
260
+ @Ignore(" Not implemented yet" )
261
+ fun exists () {
262
+ // TODO: Implement exists for BeeBlazeRepository
263
+ }
264
+
265
+ @Test
266
+ @Ignore(" Not implemented yet" )
267
+ fun `exists with composite key` () {
268
+ // TODO: Implement exists for BeeBlazeRepository
269
+ }
270
+
271
+ @Test
272
+ @Ignore(" Not implemented yet" )
273
+ fun `exists with multiple ids` () {
274
+ // TODO: Implement exists for BeeBlazeRepository
275
+ }
276
+
277
+ @Test
278
+ @Ignore(" Not implemented yet" )
279
+ fun `exists with multiple composite keys` () {
280
+ // TODO: Implement exists for BeeBlazeRepository
281
+ }
282
+
283
+ @Test
284
+ fun `update field` () {
285
+ var collectionId1: Long = - 1
286
+ var workId1 = WorkId ()
287
+
288
+ transaction.executeWithoutResult {
289
+ val collection1 = collectionRepo.persist(WorkCollection ())
290
+ collectionId1 = collection1.id
291
+ val work1 = workRepo.persist(Work (WorkId (++ workIdCount, collectionId1), " Hey!" ))
292
+ workId1 = work1.id
293
+ }
294
+
295
+ transaction.executeWithoutResult {
296
+ val work = workRepo.select {
297
+ where(WorkDSL .id.eq(workId1))
298
+ }.firstOrNull()
299
+ assertNotNull(work)
300
+ val workUpdate = work.copy(txt = " Update!" )
301
+ workRepo.update(workUpdate)
302
+ }
303
+
304
+ transaction.executeWithoutResult {
305
+ val workUpdate = workRepo.select {
306
+ where(WorkDSL .id.eq(workId1))
307
+ }.firstOrNull()
308
+
309
+ assertNotNull(workUpdate)
310
+ assertEquals(" Update!" , workUpdate.txt)
311
+ }
312
+ }
313
+
314
+ @Test
315
+ @Ignore(" Not implemented yet" )
316
+ fun `delete all` () {
317
+ // TODO: Implement delete for BeeBlazeRepository
318
+ }
319
+
320
+ @Test
321
+ @Ignore(" Not implemented yet" )
322
+ fun `delete without where clause` () {
323
+ // TODO: Implement delete for BeeBlazeRepository
324
+ }
325
+
326
+ @Test
327
+ @Ignore(" Not implemented yet" )
328
+ fun `delete by id` () {
329
+ // TODO: Implement delete for BeeBlazeRepository
330
+ }
331
+
332
+ @Test
333
+ @Ignore(" Not implemented yet" )
334
+ fun `delete by id with composite key` () {
335
+ // TODO: Implement delete for BeeBlazeRepository
336
+ }
337
+
338
+ @Test
339
+ @Ignore(" Not implemented yet" )
340
+ fun `delete by ids` () {
341
+ // TODO: Implement delete for BeeBlazeRepository
342
+ }
343
+
344
+ @Test
345
+ @Ignore(" Not implemented yet" )
346
+ fun `delete by ids with composite key` () {
347
+ // TODO: Implement delete for BeeBlazeRepository
348
+ }
349
+
350
+ @Test
351
+ @Ignore(" Not implemented yet" )
352
+ fun `delete by ids with some not existing` () {
353
+ // TODO: Implement delete for BeeBlazeRepository
354
+ }
355
+
356
+ @Test
357
+ fun rollback () {
358
+ var collectionId1: Long = - 1
359
+ var collectionId2: Long = - 1
360
+
361
+ transaction.executeWithoutResult { tx ->
362
+ val collection1 = collectionRepo.persist(WorkCollection ())
363
+ collectionId1 = collection1.id
364
+ val collection2 = collectionRepo.persist(WorkCollection ())
365
+ collectionId2 = collection2.id
366
+ tx.setRollbackOnly()
367
+ }
368
+
369
+ transaction.executeWithoutResult {
370
+ val collections = collectionRepo.select()
371
+ assertEquals(0 , collections.count())
372
+ }
373
+ }
259
374
260
375
private fun assertWorkCollection (
261
376
workCollection : WorkCollection ,
@@ -272,17 +387,7 @@ class OneToManyTest(
272
387
assertNotNull(works)
273
388
assertEquals(workIds.count(), works.count())
274
389
for (work in works) {
275
- // assertTrue { workIds.contains(work.id) }
276
390
assertWork(work, collectionId, workIds, depth - 1 )
277
-
278
- // val newDepth = depth - 1
279
- // val newWorkCollection = work.workCollection
280
- // if (newDepth != 0) {
281
- // assertNotNull(newWorkCollection)
282
- // assertWorkCollection(newWorkCollection, collectionId, workIds, newDepth)
283
- // } else {
284
- // assertNull(newWorkCollection)
285
- // }
286
391
}
287
392
}
288
393
0 commit comments