@@ -34,14 +34,6 @@ public CustomPersister(PersistentClass model, ICacheConcurrencyStrategy cache, I
3434 this . factory = factory ;
3535 }
3636
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-
4537 #region IEntityPersister Members
4638
4739 public ISessionFactoryImplementor Factory
@@ -377,21 +369,11 @@ public object ForceVersionIncrement(object id, object currentVersion, ISessionIm
377369 return null ;
378370 }
379371
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 ;
391373
392- public bool IsInstrumented ( EntityMode entityMode )
374+ public bool IsInstrumented
393375 {
394- return false ;
376+ get { return false ; }
395377 }
396378
397379 public bool HasInsertGeneratedProperties
@@ -424,7 +406,7 @@ public object CreateProxy(object id, ISessionImplementor session)
424406
425407 public object [ ] GetPropertyValuesToInsert ( object obj , IDictionary mergeMap , ISessionImplementor session )
426408 {
427- return GetPropertyValues ( obj , session . EntityMode ) ;
409+ return GetPropertyValues ( obj ) ;
428410 }
429411
430412 public void ProcessInsertGeneratedProperties ( object id , object entity , object [ ] state , ISessionImplementor session )
@@ -435,109 +417,91 @@ public void ProcessUpdateGeneratedProperties(object id, object entity, object[]
435417 {
436418 }
437419
438- public System . Type GetMappedClass ( EntityMode entityMode )
420+ public System . Type MappedClass
439421 {
440- CheckEntityMode ( entityMode ) ;
441- return typeof ( Custom ) ;
422+ get { return typeof ( Custom ) ; }
442423 }
443424
444- public bool ImplementsLifecycle ( EntityMode entityMode )
425+ public bool ImplementsLifecycle
445426 {
446- CheckEntityMode ( entityMode ) ;
447- return false ;
427+ get { return false ; }
448428 }
449429
450- public bool ImplementsValidatable ( EntityMode entityMode )
430+ public bool ImplementsValidatable
451431 {
452- CheckEntityMode ( entityMode ) ;
453- return false ;
432+ get { return false ; }
454433 }
455434
456- public System . Type GetConcreteProxyClass ( EntityMode entityMode )
435+ public System . Type ConcreteProxyClass
457436 {
458- CheckEntityMode ( entityMode ) ;
459- return typeof ( Custom ) ;
437+ get { return typeof ( Custom ) ; }
460438 }
461439
462- public void SetPropertyValues ( object obj , object [ ] values , EntityMode entityMode )
440+ public void SetPropertyValues ( object obj , object [ ] values )
463441 {
464- CheckEntityMode ( entityMode ) ;
465- SetPropertyValue ( obj , 0 , values [ 0 ] , entityMode ) ;
442+ SetPropertyValue ( obj , 0 , values [ 0 ] ) ;
466443 }
467444
468- public void SetPropertyValue ( object obj , int i , object value , EntityMode entityMode )
445+ public void SetPropertyValue ( object obj , int i , object value )
469446 {
470- CheckEntityMode ( entityMode ) ;
471447 ( ( Custom ) obj ) . Name = ( string ) value ;
472448 }
473449
474- public object [ ] GetPropertyValues ( object obj , EntityMode entityMode )
450+ public object [ ] GetPropertyValues ( object obj )
475451 {
476- CheckEntityMode ( entityMode ) ;
477452 Custom c = ( Custom ) obj ;
478453 return new Object [ ] { c . Name } ;
479454 }
480455
481- public object GetPropertyValue ( object obj , int i , EntityMode entityMode )
456+ public object GetPropertyValue ( object obj , int i )
482457 {
483- CheckEntityMode ( entityMode ) ;
484458 return ( ( Custom ) obj ) . Name ;
485459 }
486460
487- public object GetPropertyValue ( object obj , string name , EntityMode entityMode )
461+ public object GetPropertyValue ( object obj , string name )
488462 {
489- CheckEntityMode ( entityMode ) ;
490463 return ( ( Custom ) obj ) . Name ;
491464 }
492465
493- public object GetIdentifier ( object obj , EntityMode entityMode )
466+ public object GetIdentifier ( object obj )
494467 {
495- CheckEntityMode ( entityMode ) ;
496468 return ( ( Custom ) obj ) . Id ;
497469 }
498470
499- public void SetIdentifier ( object obj , object id , EntityMode entityMode )
471+ public void SetIdentifier ( object obj , object id )
500472 {
501- CheckEntityMode ( entityMode ) ;
502473 ( ( Custom ) obj ) . Id = ( string ) id ;
503474 }
504475
505- public object GetVersion ( object obj , EntityMode entityMode )
476+ public object GetVersion ( object obj )
506477 {
507- CheckEntityMode ( entityMode ) ;
508478 return null ;
509479 }
510480
511- public object Instantiate ( object id , EntityMode entityMode )
481+ public object Instantiate ( object id )
512482 {
513- CheckEntityMode ( entityMode ) ;
514483 Custom c = new Custom ( ) ;
515484 c . Id = ( string ) id ;
516485 return c ;
517486 }
518487
519- public bool IsInstance ( object entity , EntityMode entityMode )
488+ public bool IsInstance ( object entity )
520489 {
521- CheckEntityMode ( entityMode ) ;
522490 return entity is Custom ;
523491 }
524492
525- public bool HasUninitializedLazyProperties ( object obj , EntityMode entityMode )
493+ public bool HasUninitializedLazyProperties ( object obj )
526494 {
527- CheckEntityMode ( entityMode ) ;
528495 return false ;
529496 }
530497
531- public void ResetIdentifier ( object entity , object currentId , object currentVersion , EntityMode entityMode )
498+ public void ResetIdentifier ( object entity , object currentId , object currentVersion )
532499 {
533- CheckEntityMode ( entityMode ) ;
534500 ( ( Custom ) entity ) . Id = ( string ) currentId ;
535501 }
536502
537- public IEntityPersister GetSubclassEntityPersister ( object instance , ISessionFactoryImplementor factory ,
538- EntityMode entityMode )
503+ public IEntityPersister GetSubclassEntityPersister ( object instance , ISessionFactoryImplementor factory )
539504 {
540- CheckEntityMode ( entityMode ) ;
541505 return this ;
542506 }
543507
@@ -553,6 +517,8 @@ public IComparer VersionComparator
553517 get { return null ; }
554518 }
555519
520+ public IEntityTuplizer EntityTuplizer => null ;
521+
556522 #endregion
557523 }
558524}
0 commit comments