processors.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. // !nashtsai! TODO enable BeforeValidateProcessor when xorm start to support validations
  21. //// Executed before an object is validated
  22. //type BeforeValidateProcessor interface {
  23. // BeforeValidate()
  24. //}
  25. // --
  26. // Executed after an object is persisted to the database
  27. type AfterInsertProcessor interface {
  28. AfterInsert()
  29. }
  30. // Executed after an object has been updated
  31. type AfterUpdateProcessor interface {
  32. AfterUpdate()
  33. }
  34. // Executed after an object has been deleted
  35. type AfterDeleteProcessor interface {
  36. AfterDelete()
  37. }