where.go 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. // Code generated by ent, DO NOT EDIT.
  2. package userallowedgroup
  3. import (
  4. "time"
  5. "entgo.io/ent/dialect/sql"
  6. "entgo.io/ent/dialect/sql/sqlgraph"
  7. "github.com/Wei-Shaw/sub2api/ent/predicate"
  8. )
  9. // UserID applies equality check predicate on the "user_id" field. It's identical to UserIDEQ.
  10. func UserID(v int64) predicate.UserAllowedGroup {
  11. return predicate.UserAllowedGroup(sql.FieldEQ(FieldUserID, v))
  12. }
  13. // GroupID applies equality check predicate on the "group_id" field. It's identical to GroupIDEQ.
  14. func GroupID(v int64) predicate.UserAllowedGroup {
  15. return predicate.UserAllowedGroup(sql.FieldEQ(FieldGroupID, v))
  16. }
  17. // CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
  18. func CreatedAt(v time.Time) predicate.UserAllowedGroup {
  19. return predicate.UserAllowedGroup(sql.FieldEQ(FieldCreatedAt, v))
  20. }
  21. // UserIDEQ applies the EQ predicate on the "user_id" field.
  22. func UserIDEQ(v int64) predicate.UserAllowedGroup {
  23. return predicate.UserAllowedGroup(sql.FieldEQ(FieldUserID, v))
  24. }
  25. // UserIDNEQ applies the NEQ predicate on the "user_id" field.
  26. func UserIDNEQ(v int64) predicate.UserAllowedGroup {
  27. return predicate.UserAllowedGroup(sql.FieldNEQ(FieldUserID, v))
  28. }
  29. // UserIDIn applies the In predicate on the "user_id" field.
  30. func UserIDIn(vs ...int64) predicate.UserAllowedGroup {
  31. return predicate.UserAllowedGroup(sql.FieldIn(FieldUserID, vs...))
  32. }
  33. // UserIDNotIn applies the NotIn predicate on the "user_id" field.
  34. func UserIDNotIn(vs ...int64) predicate.UserAllowedGroup {
  35. return predicate.UserAllowedGroup(sql.FieldNotIn(FieldUserID, vs...))
  36. }
  37. // GroupIDEQ applies the EQ predicate on the "group_id" field.
  38. func GroupIDEQ(v int64) predicate.UserAllowedGroup {
  39. return predicate.UserAllowedGroup(sql.FieldEQ(FieldGroupID, v))
  40. }
  41. // GroupIDNEQ applies the NEQ predicate on the "group_id" field.
  42. func GroupIDNEQ(v int64) predicate.UserAllowedGroup {
  43. return predicate.UserAllowedGroup(sql.FieldNEQ(FieldGroupID, v))
  44. }
  45. // GroupIDIn applies the In predicate on the "group_id" field.
  46. func GroupIDIn(vs ...int64) predicate.UserAllowedGroup {
  47. return predicate.UserAllowedGroup(sql.FieldIn(FieldGroupID, vs...))
  48. }
  49. // GroupIDNotIn applies the NotIn predicate on the "group_id" field.
  50. func GroupIDNotIn(vs ...int64) predicate.UserAllowedGroup {
  51. return predicate.UserAllowedGroup(sql.FieldNotIn(FieldGroupID, vs...))
  52. }
  53. // CreatedAtEQ applies the EQ predicate on the "created_at" field.
  54. func CreatedAtEQ(v time.Time) predicate.UserAllowedGroup {
  55. return predicate.UserAllowedGroup(sql.FieldEQ(FieldCreatedAt, v))
  56. }
  57. // CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
  58. func CreatedAtNEQ(v time.Time) predicate.UserAllowedGroup {
  59. return predicate.UserAllowedGroup(sql.FieldNEQ(FieldCreatedAt, v))
  60. }
  61. // CreatedAtIn applies the In predicate on the "created_at" field.
  62. func CreatedAtIn(vs ...time.Time) predicate.UserAllowedGroup {
  63. return predicate.UserAllowedGroup(sql.FieldIn(FieldCreatedAt, vs...))
  64. }
  65. // CreatedAtNotIn applies the NotIn predicate on the "created_at" field.
  66. func CreatedAtNotIn(vs ...time.Time) predicate.UserAllowedGroup {
  67. return predicate.UserAllowedGroup(sql.FieldNotIn(FieldCreatedAt, vs...))
  68. }
  69. // CreatedAtGT applies the GT predicate on the "created_at" field.
  70. func CreatedAtGT(v time.Time) predicate.UserAllowedGroup {
  71. return predicate.UserAllowedGroup(sql.FieldGT(FieldCreatedAt, v))
  72. }
  73. // CreatedAtGTE applies the GTE predicate on the "created_at" field.
  74. func CreatedAtGTE(v time.Time) predicate.UserAllowedGroup {
  75. return predicate.UserAllowedGroup(sql.FieldGTE(FieldCreatedAt, v))
  76. }
  77. // CreatedAtLT applies the LT predicate on the "created_at" field.
  78. func CreatedAtLT(v time.Time) predicate.UserAllowedGroup {
  79. return predicate.UserAllowedGroup(sql.FieldLT(FieldCreatedAt, v))
  80. }
  81. // CreatedAtLTE applies the LTE predicate on the "created_at" field.
  82. func CreatedAtLTE(v time.Time) predicate.UserAllowedGroup {
  83. return predicate.UserAllowedGroup(sql.FieldLTE(FieldCreatedAt, v))
  84. }
  85. // HasUser applies the HasEdge predicate on the "user" edge.
  86. func HasUser() predicate.UserAllowedGroup {
  87. return predicate.UserAllowedGroup(func(s *sql.Selector) {
  88. step := sqlgraph.NewStep(
  89. sqlgraph.From(Table, UserColumn),
  90. sqlgraph.Edge(sqlgraph.M2O, false, UserTable, UserColumn),
  91. )
  92. sqlgraph.HasNeighbors(s, step)
  93. })
  94. }
  95. // HasUserWith applies the HasEdge predicate on the "user" edge with a given conditions (other predicates).
  96. func HasUserWith(preds ...predicate.User) predicate.UserAllowedGroup {
  97. return predicate.UserAllowedGroup(func(s *sql.Selector) {
  98. step := newUserStep()
  99. sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
  100. for _, p := range preds {
  101. p(s)
  102. }
  103. })
  104. })
  105. }
  106. // HasGroup applies the HasEdge predicate on the "group" edge.
  107. func HasGroup() predicate.UserAllowedGroup {
  108. return predicate.UserAllowedGroup(func(s *sql.Selector) {
  109. step := sqlgraph.NewStep(
  110. sqlgraph.From(Table, GroupColumn),
  111. sqlgraph.Edge(sqlgraph.M2O, false, GroupTable, GroupColumn),
  112. )
  113. sqlgraph.HasNeighbors(s, step)
  114. })
  115. }
  116. // HasGroupWith applies the HasEdge predicate on the "group" edge with a given conditions (other predicates).
  117. func HasGroupWith(preds ...predicate.Group) predicate.UserAllowedGroup {
  118. return predicate.UserAllowedGroup(func(s *sql.Selector) {
  119. step := newGroupStep()
  120. sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
  121. for _, p := range preds {
  122. p(s)
  123. }
  124. })
  125. })
  126. }
  127. // And groups predicates with the AND operator between them.
  128. func And(predicates ...predicate.UserAllowedGroup) predicate.UserAllowedGroup {
  129. return predicate.UserAllowedGroup(sql.AndPredicates(predicates...))
  130. }
  131. // Or groups predicates with the OR operator between them.
  132. func Or(predicates ...predicate.UserAllowedGroup) predicate.UserAllowedGroup {
  133. return predicate.UserAllowedGroup(sql.OrPredicates(predicates...))
  134. }
  135. // Not applies the not operator on the given predicate.
  136. func Not(p predicate.UserAllowedGroup) predicate.UserAllowedGroup {
  137. return predicate.UserAllowedGroup(sql.NotPredicates(p))
  138. }