125 lines
4.0 KiB
Go
125 lines
4.0 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|||
|
|
|
||
|
|
package stepcriterion
|
||
|
|
|
||
|
|
import (
|
||
|
|
"time"
|
||
|
|
|
||
|
|
"entgo.io/ent/dialect/sql"
|
||
|
|
)
|
||
|
|
|
||
|
|
const (
|
||
|
|
// Label holds the string label denoting the stepcriterion type in the database.
|
||
|
|
Label = "step_criterion"
|
||
|
|
// FieldID holds the string denoting the id field in the database.
|
||
|
|
FieldID = "id"
|
||
|
|
// FieldStepId holds the string denoting the stepid field in the database.
|
||
|
|
FieldStepId = "step_id"
|
||
|
|
// FieldName holds the string denoting the name field in the database.
|
||
|
|
FieldName = "name"
|
||
|
|
// FieldUnit holds the string denoting the unit field in the database.
|
||
|
|
FieldUnit = "unit"
|
||
|
|
// FieldLogic holds the string denoting the logic field in the database.
|
||
|
|
FieldLogic = "logic"
|
||
|
|
// FieldTarget holds the string denoting the target field in the database.
|
||
|
|
FieldTarget = "target"
|
||
|
|
// FieldMin holds the string denoting the min field in the database.
|
||
|
|
FieldMin = "min"
|
||
|
|
// FieldMax holds the string denoting the max field in the database.
|
||
|
|
FieldMax = "max"
|
||
|
|
// FieldCreatedAt holds the string denoting the createdat field in the database.
|
||
|
|
FieldCreatedAt = "created_at"
|
||
|
|
// Table holds the table name of the stepcriterion in the database.
|
||
|
|
Table = "step_criterion"
|
||
|
|
)
|
||
|
|
|
||
|
|
// Columns holds all SQL columns for stepcriterion fields.
|
||
|
|
var Columns = []string{
|
||
|
|
FieldID,
|
||
|
|
FieldStepId,
|
||
|
|
FieldName,
|
||
|
|
FieldUnit,
|
||
|
|
FieldLogic,
|
||
|
|
FieldTarget,
|
||
|
|
FieldMin,
|
||
|
|
FieldMax,
|
||
|
|
FieldCreatedAt,
|
||
|
|
}
|
||
|
|
|
||
|
|
// ValidColumn reports if the column name is valid (part of the table columns).
|
||
|
|
func ValidColumn(column string) bool {
|
||
|
|
for i := range Columns {
|
||
|
|
if column == Columns[i] {
|
||
|
|
return true
|
||
|
|
}
|
||
|
|
}
|
||
|
|
return false
|
||
|
|
}
|
||
|
|
|
||
|
|
var (
|
||
|
|
// NameValidator is a validator for the "name" field. It is called by the builders before save.
|
||
|
|
NameValidator func(string) error
|
||
|
|
// DefaultUnit holds the default value on creation for the "unit" field.
|
||
|
|
DefaultUnit string
|
||
|
|
// UnitValidator is a validator for the "unit" field. It is called by the builders before save.
|
||
|
|
UnitValidator func(string) error
|
||
|
|
// DefaultLogic holds the default value on creation for the "logic" field.
|
||
|
|
DefaultLogic string
|
||
|
|
// LogicValidator is a validator for the "logic" field. It is called by the builders before save.
|
||
|
|
LogicValidator func(string) error
|
||
|
|
// DefaultTarget holds the default value on creation for the "target" field.
|
||
|
|
DefaultTarget float64
|
||
|
|
// DefaultCreatedAt holds the default value on creation for the "createdAt" field.
|
||
|
|
DefaultCreatedAt func() time.Time
|
||
|
|
// IDValidator is a validator for the "id" field. It is called by the builders before save.
|
||
|
|
IDValidator func(int) error
|
||
|
|
)
|
||
|
|
|
||
|
|
// OrderOption defines the ordering options for the StepCriterion queries.
|
||
|
|
type OrderOption func(*sql.Selector)
|
||
|
|
|
||
|
|
// ByID orders the results by the id field.
|
||
|
|
func ByID(opts ...sql.OrderTermOption) OrderOption {
|
||
|
|
return sql.OrderByField(FieldID, opts...).ToFunc()
|
||
|
|
}
|
||
|
|
|
||
|
|
// ByStepId orders the results by the stepId field.
|
||
|
|
func ByStepId(opts ...sql.OrderTermOption) OrderOption {
|
||
|
|
return sql.OrderByField(FieldStepId, opts...).ToFunc()
|
||
|
|
}
|
||
|
|
|
||
|
|
// ByName orders the results by the name field.
|
||
|
|
func ByName(opts ...sql.OrderTermOption) OrderOption {
|
||
|
|
return sql.OrderByField(FieldName, opts...).ToFunc()
|
||
|
|
}
|
||
|
|
|
||
|
|
// ByUnit orders the results by the unit field.
|
||
|
|
func ByUnit(opts ...sql.OrderTermOption) OrderOption {
|
||
|
|
return sql.OrderByField(FieldUnit, opts...).ToFunc()
|
||
|
|
}
|
||
|
|
|
||
|
|
// ByLogic orders the results by the logic field.
|
||
|
|
func ByLogic(opts ...sql.OrderTermOption) OrderOption {
|
||
|
|
return sql.OrderByField(FieldLogic, opts...).ToFunc()
|
||
|
|
}
|
||
|
|
|
||
|
|
// ByTarget orders the results by the target field.
|
||
|
|
func ByTarget(opts ...sql.OrderTermOption) OrderOption {
|
||
|
|
return sql.OrderByField(FieldTarget, opts...).ToFunc()
|
||
|
|
}
|
||
|
|
|
||
|
|
// ByMin orders the results by the min field.
|
||
|
|
func ByMin(opts ...sql.OrderTermOption) OrderOption {
|
||
|
|
return sql.OrderByField(FieldMin, opts...).ToFunc()
|
||
|
|
}
|
||
|
|
|
||
|
|
// ByMax orders the results by the max field.
|
||
|
|
func ByMax(opts ...sql.OrderTermOption) OrderOption {
|
||
|
|
return sql.OrderByField(FieldMax, opts...).ToFunc()
|
||
|
|
}
|
||
|
|
|
||
|
|
// ByCreatedAt orders the results by the createdAt field.
|
||
|
|
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
|
||
|
|
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
|
||
|
|
}
|