@@ -34,14 +34,6 @@ public CustomPersister(PersistentClass model, ICacheConcurrencyStrategy cache, I
34
34
this . factory = factory ;
35
35
}
36
36
37
- private static void CheckEntityMode ( EntityMode entityMode )
38
- {
39
- if ( EntityMode . Poco != entityMode )
40
- {
41
- throw new ArgumentOutOfRangeException ( "entityMode" , "Unhandled EntityMode : " + entityMode ) ;
42
- }
43
- }
44
-
45
37
#region IEntityPersister Members
46
38
47
39
public ISessionFactoryImplementor Factory
@@ -377,21 +369,11 @@ public object ForceVersionIncrement(object id, object currentVersion, ISessionIm
377
369
return null ;
378
370
}
379
371
380
- public EntityMode ? GuessEntityMode ( object obj )
381
- {
382
- if ( ! IsInstance ( obj , EntityMode . Poco ) )
383
- {
384
- return null ;
385
- }
386
- else
387
- {
388
- return EntityMode . Poco ;
389
- }
390
- }
372
+ public EntityMode EntityMode => EntityMode . Poco ;
391
373
392
- public bool IsInstrumented ( EntityMode entityMode )
374
+ public bool IsInstrumented
393
375
{
394
- return false ;
376
+ get { return false ; }
395
377
}
396
378
397
379
public bool HasInsertGeneratedProperties
@@ -424,7 +406,7 @@ public object CreateProxy(object id, ISessionImplementor session)
424
406
425
407
public object [ ] GetPropertyValuesToInsert ( object obj , IDictionary mergeMap , ISessionImplementor session )
426
408
{
427
- return GetPropertyValues ( obj , session . EntityMode ) ;
409
+ return GetPropertyValues ( obj ) ;
428
410
}
429
411
430
412
public void ProcessInsertGeneratedProperties ( object id , object entity , object [ ] state , ISessionImplementor session )
@@ -435,109 +417,91 @@ public void ProcessUpdateGeneratedProperties(object id, object entity, object[]
435
417
{
436
418
}
437
419
438
- public System . Type GetMappedClass ( EntityMode entityMode )
420
+ public System . Type MappedClass
439
421
{
440
- CheckEntityMode ( entityMode ) ;
441
- return typeof ( Custom ) ;
422
+ get { return typeof ( Custom ) ; }
442
423
}
443
424
444
- public bool ImplementsLifecycle ( EntityMode entityMode )
425
+ public bool ImplementsLifecycle
445
426
{
446
- CheckEntityMode ( entityMode ) ;
447
- return false ;
427
+ get { return false ; }
448
428
}
449
429
450
- public bool ImplementsValidatable ( EntityMode entityMode )
430
+ public bool ImplementsValidatable
451
431
{
452
- CheckEntityMode ( entityMode ) ;
453
- return false ;
432
+ get { return false ; }
454
433
}
455
434
456
- public System . Type GetConcreteProxyClass ( EntityMode entityMode )
435
+ public System . Type ConcreteProxyClass
457
436
{
458
- CheckEntityMode ( entityMode ) ;
459
- return typeof ( Custom ) ;
437
+ get { return typeof ( Custom ) ; }
460
438
}
461
439
462
- public void SetPropertyValues ( object obj , object [ ] values , EntityMode entityMode )
440
+ public void SetPropertyValues ( object obj , object [ ] values )
463
441
{
464
- CheckEntityMode ( entityMode ) ;
465
- SetPropertyValue ( obj , 0 , values [ 0 ] , entityMode ) ;
442
+ SetPropertyValue ( obj , 0 , values [ 0 ] ) ;
466
443
}
467
444
468
- public void SetPropertyValue ( object obj , int i , object value , EntityMode entityMode )
445
+ public void SetPropertyValue ( object obj , int i , object value )
469
446
{
470
- CheckEntityMode ( entityMode ) ;
471
447
( ( Custom ) obj ) . Name = ( string ) value ;
472
448
}
473
449
474
- public object [ ] GetPropertyValues ( object obj , EntityMode entityMode )
450
+ public object [ ] GetPropertyValues ( object obj )
475
451
{
476
- CheckEntityMode ( entityMode ) ;
477
452
Custom c = ( Custom ) obj ;
478
453
return new Object [ ] { c . Name } ;
479
454
}
480
455
481
- public object GetPropertyValue ( object obj , int i , EntityMode entityMode )
456
+ public object GetPropertyValue ( object obj , int i )
482
457
{
483
- CheckEntityMode ( entityMode ) ;
484
458
return ( ( Custom ) obj ) . Name ;
485
459
}
486
460
487
- public object GetPropertyValue ( object obj , string name , EntityMode entityMode )
461
+ public object GetPropertyValue ( object obj , string name )
488
462
{
489
- CheckEntityMode ( entityMode ) ;
490
463
return ( ( Custom ) obj ) . Name ;
491
464
}
492
465
493
- public object GetIdentifier ( object obj , EntityMode entityMode )
466
+ public object GetIdentifier ( object obj )
494
467
{
495
- CheckEntityMode ( entityMode ) ;
496
468
return ( ( Custom ) obj ) . Id ;
497
469
}
498
470
499
- public void SetIdentifier ( object obj , object id , EntityMode entityMode )
471
+ public void SetIdentifier ( object obj , object id )
500
472
{
501
- CheckEntityMode ( entityMode ) ;
502
473
( ( Custom ) obj ) . Id = ( string ) id ;
503
474
}
504
475
505
- public object GetVersion ( object obj , EntityMode entityMode )
476
+ public object GetVersion ( object obj )
506
477
{
507
- CheckEntityMode ( entityMode ) ;
508
478
return null ;
509
479
}
510
480
511
- public object Instantiate ( object id , EntityMode entityMode )
481
+ public object Instantiate ( object id )
512
482
{
513
- CheckEntityMode ( entityMode ) ;
514
483
Custom c = new Custom ( ) ;
515
484
c . Id = ( string ) id ;
516
485
return c ;
517
486
}
518
487
519
- public bool IsInstance ( object entity , EntityMode entityMode )
488
+ public bool IsInstance ( object entity )
520
489
{
521
- CheckEntityMode ( entityMode ) ;
522
490
return entity is Custom ;
523
491
}
524
492
525
- public bool HasUninitializedLazyProperties ( object obj , EntityMode entityMode )
493
+ public bool HasUninitializedLazyProperties ( object obj )
526
494
{
527
- CheckEntityMode ( entityMode ) ;
528
495
return false ;
529
496
}
530
497
531
- public void ResetIdentifier ( object entity , object currentId , object currentVersion , EntityMode entityMode )
498
+ public void ResetIdentifier ( object entity , object currentId , object currentVersion )
532
499
{
533
- CheckEntityMode ( entityMode ) ;
534
500
( ( Custom ) entity ) . Id = ( string ) currentId ;
535
501
}
536
502
537
- public IEntityPersister GetSubclassEntityPersister ( object instance , ISessionFactoryImplementor factory ,
538
- EntityMode entityMode )
503
+ public IEntityPersister GetSubclassEntityPersister ( object instance , ISessionFactoryImplementor factory )
539
504
{
540
- CheckEntityMode ( entityMode ) ;
541
505
return this ;
542
506
}
543
507
@@ -553,6 +517,8 @@ public IComparer VersionComparator
553
517
get { return null ; }
554
518
}
555
519
520
+ public IEntityTuplizer EntityTuplizer => null ;
521
+
556
522
#endregion
557
523
}
558
524
}
0 commit comments