static public StudyHistory Insert(StudyHistory entity)
 {
     using (var update = PersistentStoreRegistry.GetDefaultStore().OpenUpdateContext(UpdateContextSyncMode.Flush))
     {
         StudyHistory newEntity = Insert(update, entity);
         update.Commit();
         return(newEntity);
     }
 }
        static public StudyHistory Insert(IUpdateContext update, StudyHistory entity)
        {
            var broker        = update.GetBroker <IStudyHistoryEntityBroker>();
            var updateColumns = new StudyHistoryUpdateColumns();

            updateColumns.InsertTime           = entity.InsertTime;
            updateColumns.StudyStorageKey      = entity.StudyStorageKey;
            updateColumns.StudyHistoryTypeEnum = entity.StudyHistoryTypeEnum;
            updateColumns.StudyData            = entity.StudyData;
            updateColumns.ChangeDescription    = entity.ChangeDescription;
            updateColumns.DestStudyStorageKey  = entity.DestStudyStorageKey;
            StudyHistory newEntity = broker.Insert(updateColumns);

            return(newEntity);
        }