added spray patterns
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
package ent
|
||||
|
||||
import (
|
||||
"csgowtfd/ent/matchplayer"
|
||||
"csgowtfd/ent/roundstats"
|
||||
"csgowtfd/ent/stats"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
@@ -26,31 +26,31 @@ type RoundStats struct {
|
||||
Spent uint `json:"spent,omitempty"`
|
||||
// Edges holds the relations/edges for other nodes in the graph.
|
||||
// The values are being populated by the RoundStatsQuery when eager-loading is set.
|
||||
Edges RoundStatsEdges `json:"edges"`
|
||||
stats_round_stats *int
|
||||
Edges RoundStatsEdges `json:"edges"`
|
||||
match_player_round_stats *int
|
||||
}
|
||||
|
||||
// RoundStatsEdges holds the relations/edges for other nodes in the graph.
|
||||
type RoundStatsEdges struct {
|
||||
// Stat holds the value of the stat edge.
|
||||
Stat *Stats `json:"stat,omitempty"`
|
||||
// MatchPlayer holds the value of the match_player edge.
|
||||
MatchPlayer *MatchPlayer `json:"match_player,omitempty"`
|
||||
// loadedTypes holds the information for reporting if a
|
||||
// type was loaded (or requested) in eager-loading or not.
|
||||
loadedTypes [1]bool
|
||||
}
|
||||
|
||||
// StatOrErr returns the Stat value or an error if the edge
|
||||
// MatchPlayerOrErr returns the MatchPlayer value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e RoundStatsEdges) StatOrErr() (*Stats, error) {
|
||||
func (e RoundStatsEdges) MatchPlayerOrErr() (*MatchPlayer, error) {
|
||||
if e.loadedTypes[0] {
|
||||
if e.Stat == nil {
|
||||
// The edge stat was loaded in eager-loading,
|
||||
if e.MatchPlayer == nil {
|
||||
// The edge match_player was loaded in eager-loading,
|
||||
// but was not found.
|
||||
return nil, &NotFoundError{label: stats.Label}
|
||||
return nil, &NotFoundError{label: matchplayer.Label}
|
||||
}
|
||||
return e.Stat, nil
|
||||
return e.MatchPlayer, nil
|
||||
}
|
||||
return nil, &NotLoadedError{edge: "stat"}
|
||||
return nil, &NotLoadedError{edge: "match_player"}
|
||||
}
|
||||
|
||||
// scanValues returns the types for scanning values from sql.Rows.
|
||||
@@ -60,7 +60,7 @@ func (*RoundStats) scanValues(columns []string) ([]interface{}, error) {
|
||||
switch columns[i] {
|
||||
case roundstats.FieldID, roundstats.FieldRound, roundstats.FieldBank, roundstats.FieldEquipment, roundstats.FieldSpent:
|
||||
values[i] = new(sql.NullInt64)
|
||||
case roundstats.ForeignKeys[0]: // stats_round_stats
|
||||
case roundstats.ForeignKeys[0]: // match_player_round_stats
|
||||
values[i] = new(sql.NullInt64)
|
||||
default:
|
||||
return nil, fmt.Errorf("unexpected column %q for type RoundStats", columns[i])
|
||||
@@ -109,19 +109,19 @@ func (rs *RoundStats) assignValues(columns []string, values []interface{}) error
|
||||
}
|
||||
case roundstats.ForeignKeys[0]:
|
||||
if value, ok := values[i].(*sql.NullInt64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for edge-field stats_round_stats", value)
|
||||
return fmt.Errorf("unexpected type %T for edge-field match_player_round_stats", value)
|
||||
} else if value.Valid {
|
||||
rs.stats_round_stats = new(int)
|
||||
*rs.stats_round_stats = int(value.Int64)
|
||||
rs.match_player_round_stats = new(int)
|
||||
*rs.match_player_round_stats = int(value.Int64)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// QueryStat queries the "stat" edge of the RoundStats entity.
|
||||
func (rs *RoundStats) QueryStat() *StatsQuery {
|
||||
return (&RoundStatsClient{config: rs.config}).QueryStat(rs)
|
||||
// QueryMatchPlayer queries the "match_player" edge of the RoundStats entity.
|
||||
func (rs *RoundStats) QueryMatchPlayer() *MatchPlayerQuery {
|
||||
return (&RoundStatsClient{config: rs.config}).QueryMatchPlayer(rs)
|
||||
}
|
||||
|
||||
// Update returns a builder for updating this RoundStats.
|
||||
|
Reference in New Issue
Block a user