workexperience.go 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. // Code generated by ent, DO NOT EDIT.
  2. package workexperience
  3. import (
  4. "time"
  5. "entgo.io/ent"
  6. "entgo.io/ent/dialect/sql"
  7. "entgo.io/ent/dialect/sql/sqlgraph"
  8. )
  9. const (
  10. // Label holds the string label denoting the workexperience type in the database.
  11. Label = "work_experience"
  12. // FieldID holds the string denoting the id field in the database.
  13. FieldID = "id"
  14. // FieldCreatedAt holds the string denoting the created_at field in the database.
  15. FieldCreatedAt = "created_at"
  16. // FieldUpdatedAt holds the string denoting the updated_at field in the database.
  17. FieldUpdatedAt = "updated_at"
  18. // FieldDeletedAt holds the string denoting the deleted_at field in the database.
  19. FieldDeletedAt = "deleted_at"
  20. // FieldEmployeeID holds the string denoting the employee_id field in the database.
  21. FieldEmployeeID = "employee_id"
  22. // FieldStartDate holds the string denoting the start_date field in the database.
  23. FieldStartDate = "start_date"
  24. // FieldEndDate holds the string denoting the end_date field in the database.
  25. FieldEndDate = "end_date"
  26. // FieldCompany holds the string denoting the company field in the database.
  27. FieldCompany = "company"
  28. // FieldExperience holds the string denoting the experience field in the database.
  29. FieldExperience = "experience"
  30. // FieldOrganizationID holds the string denoting the organization_id field in the database.
  31. FieldOrganizationID = "organization_id"
  32. // EdgeEmployee holds the string denoting the employee edge name in mutations.
  33. EdgeEmployee = "employee"
  34. // Table holds the table name of the workexperience in the database.
  35. Table = "work_experience"
  36. // EmployeeTable is the table that holds the employee relation/edge.
  37. EmployeeTable = "work_experience"
  38. // EmployeeInverseTable is the table name for the Employee entity.
  39. // It exists in this package in order to avoid circular dependency with the "employee" package.
  40. EmployeeInverseTable = "employee"
  41. // EmployeeColumn is the table column denoting the employee relation/edge.
  42. EmployeeColumn = "employee_id"
  43. )
  44. // Columns holds all SQL columns for workexperience fields.
  45. var Columns = []string{
  46. FieldID,
  47. FieldCreatedAt,
  48. FieldUpdatedAt,
  49. FieldDeletedAt,
  50. FieldEmployeeID,
  51. FieldStartDate,
  52. FieldEndDate,
  53. FieldCompany,
  54. FieldExperience,
  55. FieldOrganizationID,
  56. }
  57. // ValidColumn reports if the column name is valid (part of the table columns).
  58. func ValidColumn(column string) bool {
  59. for i := range Columns {
  60. if column == Columns[i] {
  61. return true
  62. }
  63. }
  64. return false
  65. }
  66. // Note that the variables below are initialized by the runtime
  67. // package on the initialization of the application. Therefore,
  68. // it should be imported in the main as follows:
  69. //
  70. // import _ "wechat-api/ent/runtime"
  71. var (
  72. Hooks [1]ent.Hook
  73. Interceptors [1]ent.Interceptor
  74. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  75. DefaultCreatedAt func() time.Time
  76. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  77. DefaultUpdatedAt func() time.Time
  78. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  79. UpdateDefaultUpdatedAt func() time.Time
  80. )
  81. // OrderOption defines the ordering options for the WorkExperience queries.
  82. type OrderOption func(*sql.Selector)
  83. // ByID orders the results by the id field.
  84. func ByID(opts ...sql.OrderTermOption) OrderOption {
  85. return sql.OrderByField(FieldID, opts...).ToFunc()
  86. }
  87. // ByCreatedAt orders the results by the created_at field.
  88. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  89. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  90. }
  91. // ByUpdatedAt orders the results by the updated_at field.
  92. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  93. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  94. }
  95. // ByDeletedAt orders the results by the deleted_at field.
  96. func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
  97. return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
  98. }
  99. // ByEmployeeID orders the results by the employee_id field.
  100. func ByEmployeeID(opts ...sql.OrderTermOption) OrderOption {
  101. return sql.OrderByField(FieldEmployeeID, opts...).ToFunc()
  102. }
  103. // ByStartDate orders the results by the start_date field.
  104. func ByStartDate(opts ...sql.OrderTermOption) OrderOption {
  105. return sql.OrderByField(FieldStartDate, opts...).ToFunc()
  106. }
  107. // ByEndDate orders the results by the end_date field.
  108. func ByEndDate(opts ...sql.OrderTermOption) OrderOption {
  109. return sql.OrderByField(FieldEndDate, opts...).ToFunc()
  110. }
  111. // ByCompany orders the results by the company field.
  112. func ByCompany(opts ...sql.OrderTermOption) OrderOption {
  113. return sql.OrderByField(FieldCompany, opts...).ToFunc()
  114. }
  115. // ByExperience orders the results by the experience field.
  116. func ByExperience(opts ...sql.OrderTermOption) OrderOption {
  117. return sql.OrderByField(FieldExperience, opts...).ToFunc()
  118. }
  119. // ByOrganizationID orders the results by the organization_id field.
  120. func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption {
  121. return sql.OrderByField(FieldOrganizationID, opts...).ToFunc()
  122. }
  123. // ByEmployeeField orders the results by employee field.
  124. func ByEmployeeField(field string, opts ...sql.OrderTermOption) OrderOption {
  125. return func(s *sql.Selector) {
  126. sqlgraph.OrderByNeighborTerms(s, newEmployeeStep(), sql.OrderByField(field, opts...))
  127. }
  128. }
  129. func newEmployeeStep() *sqlgraph.Step {
  130. return sqlgraph.NewStep(
  131. sqlgraph.From(Table, FieldID),
  132. sqlgraph.To(EmployeeInverseTable, FieldID),
  133. sqlgraph.Edge(sqlgraph.M2O, true, EmployeeTable, EmployeeColumn),
  134. )
  135. }