sopnode.go 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. // Code generated by ent, DO NOT EDIT.
  2. package sopnode
  3. import (
  4. "time"
  5. "entgo.io/ent/dialect/sql"
  6. "entgo.io/ent/dialect/sql/sqlgraph"
  7. )
  8. const (
  9. // Label holds the string label denoting the sopnode type in the database.
  10. Label = "sop_node"
  11. // FieldID holds the string denoting the id field in the database.
  12. FieldID = "id"
  13. // FieldCreatedAt holds the string denoting the created_at field in the database.
  14. FieldCreatedAt = "created_at"
  15. // FieldUpdatedAt holds the string denoting the updated_at field in the database.
  16. FieldUpdatedAt = "updated_at"
  17. // FieldStatus holds the string denoting the status field in the database.
  18. FieldStatus = "status"
  19. // FieldStageID holds the string denoting the stage_id field in the database.
  20. FieldStageID = "stage_id"
  21. // FieldParentID holds the string denoting the parent_id field in the database.
  22. FieldParentID = "parent_id"
  23. // FieldName holds the string denoting the name field in the database.
  24. FieldName = "name"
  25. // FieldConditionType holds the string denoting the condition_type field in the database.
  26. FieldConditionType = "condition_type"
  27. // FieldConditionList holds the string denoting the condition_list field in the database.
  28. FieldConditionList = "condition_list"
  29. // FieldNoReplyCondition holds the string denoting the no_reply_condition field in the database.
  30. FieldNoReplyCondition = "no_reply_condition"
  31. // FieldActionMessage holds the string denoting the action_message field in the database.
  32. FieldActionMessage = "action_message"
  33. // FieldActionLabel holds the string denoting the action_label field in the database.
  34. FieldActionLabel = "action_label"
  35. // FieldDeletedAt holds the string denoting the deleted_at field in the database.
  36. FieldDeletedAt = "deleted_at"
  37. // EdgeSopStage holds the string denoting the sop_stage edge name in mutations.
  38. EdgeSopStage = "sop_stage"
  39. // EdgeNodeMessages holds the string denoting the node_messages edge name in mutations.
  40. EdgeNodeMessages = "node_messages"
  41. // Table holds the table name of the sopnode in the database.
  42. Table = "sop_node"
  43. // SopStageTable is the table that holds the sop_stage relation/edge.
  44. SopStageTable = "sop_node"
  45. // SopStageInverseTable is the table name for the SopStage entity.
  46. // It exists in this package in order to avoid circular dependency with the "sopstage" package.
  47. SopStageInverseTable = "sop_stage"
  48. // SopStageColumn is the table column denoting the sop_stage relation/edge.
  49. SopStageColumn = "stage_id"
  50. // NodeMessagesTable is the table that holds the node_messages relation/edge.
  51. NodeMessagesTable = "message_records"
  52. // NodeMessagesInverseTable is the table name for the MessageRecords entity.
  53. // It exists in this package in order to avoid circular dependency with the "messagerecords" package.
  54. NodeMessagesInverseTable = "message_records"
  55. // NodeMessagesColumn is the table column denoting the node_messages relation/edge.
  56. NodeMessagesColumn = "sop_node_node_messages"
  57. )
  58. // Columns holds all SQL columns for sopnode fields.
  59. var Columns = []string{
  60. FieldID,
  61. FieldCreatedAt,
  62. FieldUpdatedAt,
  63. FieldStatus,
  64. FieldStageID,
  65. FieldParentID,
  66. FieldName,
  67. FieldConditionType,
  68. FieldConditionList,
  69. FieldNoReplyCondition,
  70. FieldActionMessage,
  71. FieldActionLabel,
  72. FieldDeletedAt,
  73. }
  74. // ValidColumn reports if the column name is valid (part of the table columns).
  75. func ValidColumn(column string) bool {
  76. for i := range Columns {
  77. if column == Columns[i] {
  78. return true
  79. }
  80. }
  81. return false
  82. }
  83. var (
  84. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  85. DefaultCreatedAt func() time.Time
  86. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  87. DefaultUpdatedAt func() time.Time
  88. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  89. UpdateDefaultUpdatedAt func() time.Time
  90. // DefaultStatus holds the default value on creation for the "status" field.
  91. DefaultStatus uint8
  92. // DefaultName holds the default value on creation for the "name" field.
  93. DefaultName string
  94. // DefaultConditionType holds the default value on creation for the "condition_type" field.
  95. DefaultConditionType int
  96. // DefaultNoReplyCondition holds the default value on creation for the "no_reply_condition" field.
  97. DefaultNoReplyCondition uint64
  98. )
  99. // OrderOption defines the ordering options for the SopNode queries.
  100. type OrderOption func(*sql.Selector)
  101. // ByID orders the results by the id field.
  102. func ByID(opts ...sql.OrderTermOption) OrderOption {
  103. return sql.OrderByField(FieldID, opts...).ToFunc()
  104. }
  105. // ByCreatedAt orders the results by the created_at field.
  106. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  107. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  108. }
  109. // ByUpdatedAt orders the results by the updated_at field.
  110. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  111. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  112. }
  113. // ByStatus orders the results by the status field.
  114. func ByStatus(opts ...sql.OrderTermOption) OrderOption {
  115. return sql.OrderByField(FieldStatus, opts...).ToFunc()
  116. }
  117. // ByStageID orders the results by the stage_id field.
  118. func ByStageID(opts ...sql.OrderTermOption) OrderOption {
  119. return sql.OrderByField(FieldStageID, opts...).ToFunc()
  120. }
  121. // ByParentID orders the results by the parent_id field.
  122. func ByParentID(opts ...sql.OrderTermOption) OrderOption {
  123. return sql.OrderByField(FieldParentID, opts...).ToFunc()
  124. }
  125. // ByName orders the results by the name field.
  126. func ByName(opts ...sql.OrderTermOption) OrderOption {
  127. return sql.OrderByField(FieldName, opts...).ToFunc()
  128. }
  129. // ByConditionType orders the results by the condition_type field.
  130. func ByConditionType(opts ...sql.OrderTermOption) OrderOption {
  131. return sql.OrderByField(FieldConditionType, opts...).ToFunc()
  132. }
  133. // ByNoReplyCondition orders the results by the no_reply_condition field.
  134. func ByNoReplyCondition(opts ...sql.OrderTermOption) OrderOption {
  135. return sql.OrderByField(FieldNoReplyCondition, opts...).ToFunc()
  136. }
  137. // ByDeletedAt orders the results by the deleted_at field.
  138. func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
  139. return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
  140. }
  141. // BySopStageField orders the results by sop_stage field.
  142. func BySopStageField(field string, opts ...sql.OrderTermOption) OrderOption {
  143. return func(s *sql.Selector) {
  144. sqlgraph.OrderByNeighborTerms(s, newSopStageStep(), sql.OrderByField(field, opts...))
  145. }
  146. }
  147. // ByNodeMessagesCount orders the results by node_messages count.
  148. func ByNodeMessagesCount(opts ...sql.OrderTermOption) OrderOption {
  149. return func(s *sql.Selector) {
  150. sqlgraph.OrderByNeighborsCount(s, newNodeMessagesStep(), opts...)
  151. }
  152. }
  153. // ByNodeMessages orders the results by node_messages terms.
  154. func ByNodeMessages(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
  155. return func(s *sql.Selector) {
  156. sqlgraph.OrderByNeighborTerms(s, newNodeMessagesStep(), append([]sql.OrderTerm{term}, terms...)...)
  157. }
  158. }
  159. func newSopStageStep() *sqlgraph.Step {
  160. return sqlgraph.NewStep(
  161. sqlgraph.From(Table, FieldID),
  162. sqlgraph.To(SopStageInverseTable, FieldID),
  163. sqlgraph.Edge(sqlgraph.M2O, true, SopStageTable, SopStageColumn),
  164. )
  165. }
  166. func newNodeMessagesStep() *sqlgraph.Step {
  167. return sqlgraph.NewStep(
  168. sqlgraph.From(Table, FieldID),
  169. sqlgraph.To(NodeMessagesInverseTable, FieldID),
  170. sqlgraph.Edge(sqlgraph.O2M, false, NodeMessagesTable, NodeMessagesColumn),
  171. )
  172. }