168 lines
5.6 KiB
Go
168 lines
5.6 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package lienobjetemplacement
|
|
|
|
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 lienobjetemplacement type in the database.
|
|
Label = "lien_objet_emplacement"
|
|
// 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"
|
|
// FieldEmplacementID holds the string denoting the emplacement_id field in the database.
|
|
FieldEmplacementID = "emplacement_id"
|
|
// FieldType holds the string denoting the type field in the database.
|
|
FieldType = "type"
|
|
// 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"
|
|
// EdgeEmplacement holds the string denoting the emplacement edge name in mutations.
|
|
EdgeEmplacement = "emplacement"
|
|
// Table holds the table name of the lienobjetemplacement in the database.
|
|
Table = "lien_objet_emplacement"
|
|
// ObjetTable is the table that holds the objet relation/edge.
|
|
ObjetTable = "lien_objet_emplacement"
|
|
// 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"
|
|
// EmplacementTable is the table that holds the emplacement relation/edge.
|
|
EmplacementTable = "lien_objet_emplacement"
|
|
// EmplacementInverseTable is the table name for the Emplacement entity.
|
|
// It exists in this package in order to avoid circular dependency with the "emplacement" package.
|
|
EmplacementInverseTable = "emplacement"
|
|
// EmplacementColumn is the table column denoting the emplacement relation/edge.
|
|
EmplacementColumn = "emplacement_id"
|
|
)
|
|
|
|
// Columns holds all SQL columns for lienobjetemplacement fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldObjetID,
|
|
FieldEmplacementID,
|
|
FieldType,
|
|
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 (
|
|
// 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
|
|
)
|
|
|
|
// Type defines the type for the "type" enum field.
|
|
type Type string
|
|
|
|
// TypeStocke is the default value of the Type enum.
|
|
const DefaultType = TypeStocke
|
|
|
|
// Type values.
|
|
const (
|
|
TypeStocke Type = "stocke"
|
|
TypeUtiliseDans Type = "utilise_dans"
|
|
)
|
|
|
|
func (_type Type) String() string {
|
|
return string(_type)
|
|
}
|
|
|
|
// TypeValidator is a validator for the "type" field enum values. It is called by the builders before save.
|
|
func TypeValidator(_type Type) error {
|
|
switch _type {
|
|
case TypeStocke, TypeUtiliseDans:
|
|
return nil
|
|
default:
|
|
return fmt.Errorf("lienobjetemplacement: invalid enum value for type field: %q", _type)
|
|
}
|
|
}
|
|
|
|
// OrderOption defines the ordering options for the LienObjetEmplacement 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()
|
|
}
|
|
|
|
// ByEmplacementID orders the results by the emplacement_id field.
|
|
func ByEmplacementID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldEmplacementID, opts...).ToFunc()
|
|
}
|
|
|
|
// ByType orders the results by the type field.
|
|
func ByType(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldType, 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...))
|
|
}
|
|
}
|
|
|
|
// ByEmplacementField orders the results by emplacement field.
|
|
func ByEmplacementField(field string, opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newEmplacementStep(), 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),
|
|
)
|
|
}
|
|
func newEmplacementStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(EmplacementInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.M2O, true, EmplacementTable, EmplacementColumn),
|
|
)
|
|
}
|