@ Override public boolean insert ( T entity ) { if ( entity == null ) { return false ; } X primaryID = getPrimaryID ( entity ) ; if ( primaryID != null ) { if ( ! allowEmptyOrZeroID ( ) && AssertUtils . isEmpty ( primaryID ) ) { return false ; } } try { this . mongoTemplate . insert ( entity ) ; } catch ( RuntimeException e ) { // this ensures that any insert operation that fails returns a false return false ; } return true ; }
Insert the object into the data store .