github.com/insionng/yougam@v0.0.0-20170714101924-2bc18d833463/libraries/go-xorm/xorm/processors.go (about) 1 // Copyright 2015 The Xorm Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package xorm 6 7 // BeforeInsertProcessor executed before an object is initially persisted to the database 8 type BeforeInsertProcessor interface { 9 BeforeInsert() 10 } 11 12 // BeforeUpdateProcessor executed before an object is updated 13 type BeforeUpdateProcessor interface { 14 BeforeUpdate() 15 } 16 17 // BeforeDeleteProcessor executed before an object is deleted 18 type BeforeDeleteProcessor interface { 19 BeforeDelete() 20 } 21 22 type BeforeSetProcessor interface { 23 BeforeSet(string, Cell) 24 } 25 26 type AfterSetProcessor interface { 27 AfterSet(string, Cell) 28 } 29 30 // !nashtsai! TODO enable BeforeValidateProcessor when xorm start to support validations 31 //// Executed before an object is validated 32 //type BeforeValidateProcessor interface { 33 // BeforeValidate() 34 //} 35 // -- 36 37 // AfterInsertProcessor executed after an object is persisted to the database 38 type AfterInsertProcessor interface { 39 AfterInsert() 40 } 41 42 // AfterUpdateProcessor executed after an object has been updated 43 type AfterUpdateProcessor interface { 44 AfterUpdate() 45 } 46 47 // AfterDeleteProcessor executed after an object has been deleted 48 type AfterDeleteProcessor interface { 49 AfterDelete() 50 }