regenerate ent
This commit is contained in:
50
ent/spray.go
50
ent/spray.go
@@ -40,12 +40,10 @@ type SprayEdges struct {
|
||||
// MatchPlayersOrErr returns the MatchPlayers value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e SprayEdges) MatchPlayersOrErr() (*MatchPlayer, error) {
|
||||
if e.loadedTypes[0] {
|
||||
if e.MatchPlayers == nil {
|
||||
// Edge was loaded but was not found.
|
||||
return nil, &NotFoundError{label: matchplayer.Label}
|
||||
}
|
||||
if e.MatchPlayers != nil {
|
||||
return e.MatchPlayers, nil
|
||||
} else if e.loadedTypes[0] {
|
||||
return nil, &NotFoundError{label: matchplayer.Label}
|
||||
}
|
||||
return nil, &NotLoadedError{edge: "match_players"}
|
||||
}
|
||||
@@ -70,7 +68,7 @@ func (*Spray) scanValues(columns []string) ([]any, error) {
|
||||
|
||||
// assignValues assigns the values that were returned from sql.Rows (after scanning)
|
||||
// to the Spray fields.
|
||||
func (s *Spray) assignValues(columns []string, values []any) error {
|
||||
func (_m *Spray) assignValues(columns []string, values []any) error {
|
||||
if m, n := len(values), len(columns); m < n {
|
||||
return fmt.Errorf("mismatch number of scan values: %d != %d", m, n)
|
||||
}
|
||||
@@ -81,28 +79,28 @@ func (s *Spray) assignValues(columns []string, values []any) error {
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field id", value)
|
||||
}
|
||||
s.ID = int(value.Int64)
|
||||
_m.ID = int(value.Int64)
|
||||
case spray.FieldWeapon:
|
||||
if value, ok := values[i].(*sql.NullInt64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field weapon", values[i])
|
||||
} else if value.Valid {
|
||||
s.Weapon = int(value.Int64)
|
||||
_m.Weapon = int(value.Int64)
|
||||
}
|
||||
case spray.FieldSpray:
|
||||
if value, ok := values[i].(*[]byte); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field spray", values[i])
|
||||
} else if value != nil {
|
||||
s.Spray = *value
|
||||
_m.Spray = *value
|
||||
}
|
||||
case spray.ForeignKeys[0]:
|
||||
if value, ok := values[i].(*sql.NullInt64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for edge-field match_player_spray", value)
|
||||
} else if value.Valid {
|
||||
s.match_player_spray = new(int)
|
||||
*s.match_player_spray = int(value.Int64)
|
||||
_m.match_player_spray = new(int)
|
||||
*_m.match_player_spray = int(value.Int64)
|
||||
}
|
||||
default:
|
||||
s.selectValues.Set(columns[i], values[i])
|
||||
_m.selectValues.Set(columns[i], values[i])
|
||||
}
|
||||
}
|
||||
return nil
|
||||
@@ -110,43 +108,43 @@ func (s *Spray) assignValues(columns []string, values []any) error {
|
||||
|
||||
// Value returns the ent.Value that was dynamically selected and assigned to the Spray.
|
||||
// This includes values selected through modifiers, order, etc.
|
||||
func (s *Spray) Value(name string) (ent.Value, error) {
|
||||
return s.selectValues.Get(name)
|
||||
func (_m *Spray) Value(name string) (ent.Value, error) {
|
||||
return _m.selectValues.Get(name)
|
||||
}
|
||||
|
||||
// QueryMatchPlayers queries the "match_players" edge of the Spray entity.
|
||||
func (s *Spray) QueryMatchPlayers() *MatchPlayerQuery {
|
||||
return NewSprayClient(s.config).QueryMatchPlayers(s)
|
||||
func (_m *Spray) QueryMatchPlayers() *MatchPlayerQuery {
|
||||
return NewSprayClient(_m.config).QueryMatchPlayers(_m)
|
||||
}
|
||||
|
||||
// Update returns a builder for updating this Spray.
|
||||
// Note that you need to call Spray.Unwrap() before calling this method if this Spray
|
||||
// was returned from a transaction, and the transaction was committed or rolled back.
|
||||
func (s *Spray) Update() *SprayUpdateOne {
|
||||
return NewSprayClient(s.config).UpdateOne(s)
|
||||
func (_m *Spray) Update() *SprayUpdateOne {
|
||||
return NewSprayClient(_m.config).UpdateOne(_m)
|
||||
}
|
||||
|
||||
// Unwrap unwraps the Spray entity that was returned from a transaction after it was closed,
|
||||
// so that all future queries will be executed through the driver which created the transaction.
|
||||
func (s *Spray) Unwrap() *Spray {
|
||||
_tx, ok := s.config.driver.(*txDriver)
|
||||
func (_m *Spray) Unwrap() *Spray {
|
||||
_tx, ok := _m.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: Spray is not a transactional entity")
|
||||
}
|
||||
s.config.driver = _tx.drv
|
||||
return s
|
||||
_m.config.driver = _tx.drv
|
||||
return _m
|
||||
}
|
||||
|
||||
// String implements the fmt.Stringer.
|
||||
func (s *Spray) String() string {
|
||||
func (_m *Spray) String() string {
|
||||
var builder strings.Builder
|
||||
builder.WriteString("Spray(")
|
||||
builder.WriteString(fmt.Sprintf("id=%v, ", s.ID))
|
||||
builder.WriteString(fmt.Sprintf("id=%v, ", _m.ID))
|
||||
builder.WriteString("weapon=")
|
||||
builder.WriteString(fmt.Sprintf("%v", s.Weapon))
|
||||
builder.WriteString(fmt.Sprintf("%v", _m.Weapon))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("spray=")
|
||||
builder.WriteString(fmt.Sprintf("%v", s.Spray))
|
||||
builder.WriteString(fmt.Sprintf("%v", _m.Spray))
|
||||
builder.WriteByte(')')
|
||||
return builder.String()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user