165 lines
5.4 KiB
Go
165 lines
5.4 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package champpersonnalise
|
|
|
|
import (
|
|
"fmt"
|
|
"time"
|
|
|
|
"entgo.io/ent/dialect/sql"
|
|
"entgo.io/ent/dialect/sql/sqlgraph"
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
const (
|
|
// Label holds the string label denoting the champpersonnalise type in the database.
|
|
Label = "champ_personnalise"
|
|
// FieldID holds the string denoting the id field in the database.
|
|
FieldID = "id"
|
|
// FieldObjetID holds the string denoting the objet_id field in the database.
|
|
FieldObjetID = "objet_id"
|
|
// FieldNomChamp holds the string denoting the nom_champ field in the database.
|
|
FieldNomChamp = "nom_champ"
|
|
// FieldTypeChamp holds the string denoting the type_champ field in the database.
|
|
FieldTypeChamp = "type_champ"
|
|
// FieldValeur holds the string denoting the valeur field in the database.
|
|
FieldValeur = "valeur"
|
|
// FieldUnite holds the string denoting the unite field in the database.
|
|
FieldUnite = "unite"
|
|
// FieldCreatedAt holds the string denoting the created_at field in the database.
|
|
FieldCreatedAt = "created_at"
|
|
// FieldUpdatedAt holds the string denoting the updated_at field in the database.
|
|
FieldUpdatedAt = "updated_at"
|
|
// EdgeObjet holds the string denoting the objet edge name in mutations.
|
|
EdgeObjet = "objet"
|
|
// Table holds the table name of the champpersonnalise in the database.
|
|
Table = "champ_personnalise"
|
|
// ObjetTable is the table that holds the objet relation/edge.
|
|
ObjetTable = "champ_personnalise"
|
|
// ObjetInverseTable is the table name for the Objet entity.
|
|
// It exists in this package in order to avoid circular dependency with the "objet" package.
|
|
ObjetInverseTable = "objet"
|
|
// ObjetColumn is the table column denoting the objet relation/edge.
|
|
ObjetColumn = "objet_id"
|
|
)
|
|
|
|
// Columns holds all SQL columns for champpersonnalise fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldObjetID,
|
|
FieldNomChamp,
|
|
FieldTypeChamp,
|
|
FieldValeur,
|
|
FieldUnite,
|
|
FieldCreatedAt,
|
|
FieldUpdatedAt,
|
|
}
|
|
|
|
// 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 (
|
|
// NomChampValidator is a validator for the "nom_champ" field. It is called by the builders before save.
|
|
NomChampValidator func(string) error
|
|
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
|
|
DefaultCreatedAt func() time.Time
|
|
// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
|
|
DefaultUpdatedAt func() time.Time
|
|
// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
|
|
UpdateDefaultUpdatedAt func() time.Time
|
|
// DefaultID holds the default value on creation for the "id" field.
|
|
DefaultID func() uuid.UUID
|
|
)
|
|
|
|
// TypeChamp defines the type for the "type_champ" enum field.
|
|
type TypeChamp string
|
|
|
|
// TypeChampString is the default value of the TypeChamp enum.
|
|
const DefaultTypeChamp = TypeChampString
|
|
|
|
// TypeChamp values.
|
|
const (
|
|
TypeChampString TypeChamp = "string"
|
|
TypeChampInt TypeChamp = "int"
|
|
TypeChampBool TypeChamp = "bool"
|
|
TypeChampDate TypeChamp = "date"
|
|
)
|
|
|
|
func (tc TypeChamp) String() string {
|
|
return string(tc)
|
|
}
|
|
|
|
// TypeChampValidator is a validator for the "type_champ" field enum values. It is called by the builders before save.
|
|
func TypeChampValidator(tc TypeChamp) error {
|
|
switch tc {
|
|
case TypeChampString, TypeChampInt, TypeChampBool, TypeChampDate:
|
|
return nil
|
|
default:
|
|
return fmt.Errorf("champpersonnalise: invalid enum value for type_champ field: %q", tc)
|
|
}
|
|
}
|
|
|
|
// OrderOption defines the ordering options for the ChampPersonnalise 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()
|
|
}
|
|
|
|
// ByObjetID orders the results by the objet_id field.
|
|
func ByObjetID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldObjetID, opts...).ToFunc()
|
|
}
|
|
|
|
// ByNomChamp orders the results by the nom_champ field.
|
|
func ByNomChamp(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldNomChamp, opts...).ToFunc()
|
|
}
|
|
|
|
// ByTypeChamp orders the results by the type_champ field.
|
|
func ByTypeChamp(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldTypeChamp, opts...).ToFunc()
|
|
}
|
|
|
|
// ByValeur orders the results by the valeur field.
|
|
func ByValeur(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldValeur, opts...).ToFunc()
|
|
}
|
|
|
|
// ByUnite orders the results by the unite field.
|
|
func ByUnite(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldUnite, opts...).ToFunc()
|
|
}
|
|
|
|
// ByCreatedAt orders the results by the created_at field.
|
|
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
|
|
}
|
|
|
|
// ByUpdatedAt orders the results by the updated_at field.
|
|
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
|
|
}
|
|
|
|
// ByObjetField orders the results by objet field.
|
|
func ByObjetField(field string, opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newObjetStep(), sql.OrderByField(field, opts...))
|
|
}
|
|
}
|
|
func newObjetStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(ObjetInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.M2O, true, ObjetTable, ObjetColumn),
|
|
)
|
|
}
|