processors.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. package xorm
  5. // Executed before an object is initially persisted to the database
  6. type BeforeInsertProcessor interface {
  7. BeforeInsert()
  8. }
  9. // Executed before an object is updated
  10. type BeforeUpdateProcessor interface {
  11. BeforeUpdate()
  12. }
  13. // Executed before an object is deleted
  14. type BeforeDeleteProcessor interface {
  15. BeforeDelete()
  16. }
  17. type BeforeSetProcessor interface {
  18. BeforeSet(string, Cell)
  19. }
  20. type AfterSetProcessor interface {
  21. AfterSet(string, Cell)
  22. }
  23. // !nashtsai! TODO enable BeforeValidateProcessor when xorm start to support validations
  24. //// Executed before an object is validated
  25. //type BeforeValidateProcessor interface {
  26. // BeforeValidate()
  27. //}
  28. // --
  29. // Executed after an object is persisted to the database
  30. type AfterInsertProcessor interface {
  31. AfterInsert()
  32. }
  33. // Executed after an object has been updated
  34. type AfterUpdateProcessor interface {
  35. AfterUpdate()
  36. }
  37. // Executed after an object has been deleted
  38. type AfterDeleteProcessor interface {
  39. AfterDelete()
  40. }