added spray patterns
This commit is contained in:
@@ -4,8 +4,8 @@ package ent
|
||||
|
||||
import (
|
||||
"context"
|
||||
"csgowtfd/ent/matchplayer"
|
||||
"csgowtfd/ent/roundstats"
|
||||
"csgowtfd/ent/stats"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
@@ -44,23 +44,23 @@ func (rsc *RoundStatsCreate) SetSpent(u uint) *RoundStatsCreate {
|
||||
return rsc
|
||||
}
|
||||
|
||||
// SetStatID sets the "stat" edge to the Stats entity by ID.
|
||||
func (rsc *RoundStatsCreate) SetStatID(id int) *RoundStatsCreate {
|
||||
rsc.mutation.SetStatID(id)
|
||||
// SetMatchPlayerID sets the "match_player" edge to the MatchPlayer entity by ID.
|
||||
func (rsc *RoundStatsCreate) SetMatchPlayerID(id int) *RoundStatsCreate {
|
||||
rsc.mutation.SetMatchPlayerID(id)
|
||||
return rsc
|
||||
}
|
||||
|
||||
// SetNillableStatID sets the "stat" edge to the Stats entity by ID if the given value is not nil.
|
||||
func (rsc *RoundStatsCreate) SetNillableStatID(id *int) *RoundStatsCreate {
|
||||
// SetNillableMatchPlayerID sets the "match_player" edge to the MatchPlayer entity by ID if the given value is not nil.
|
||||
func (rsc *RoundStatsCreate) SetNillableMatchPlayerID(id *int) *RoundStatsCreate {
|
||||
if id != nil {
|
||||
rsc = rsc.SetStatID(*id)
|
||||
rsc = rsc.SetMatchPlayerID(*id)
|
||||
}
|
||||
return rsc
|
||||
}
|
||||
|
||||
// SetStat sets the "stat" edge to the Stats entity.
|
||||
func (rsc *RoundStatsCreate) SetStat(s *Stats) *RoundStatsCreate {
|
||||
return rsc.SetStatID(s.ID)
|
||||
// SetMatchPlayer sets the "match_player" edge to the MatchPlayer entity.
|
||||
func (rsc *RoundStatsCreate) SetMatchPlayer(m *MatchPlayer) *RoundStatsCreate {
|
||||
return rsc.SetMatchPlayerID(m.ID)
|
||||
}
|
||||
|
||||
// Mutation returns the RoundStatsMutation object of the builder.
|
||||
@@ -204,24 +204,24 @@ func (rsc *RoundStatsCreate) createSpec() (*RoundStats, *sqlgraph.CreateSpec) {
|
||||
})
|
||||
_node.Spent = value
|
||||
}
|
||||
if nodes := rsc.mutation.StatIDs(); len(nodes) > 0 {
|
||||
if nodes := rsc.mutation.MatchPlayerIDs(); len(nodes) > 0 {
|
||||
edge := &sqlgraph.EdgeSpec{
|
||||
Rel: sqlgraph.M2O,
|
||||
Inverse: true,
|
||||
Table: roundstats.StatTable,
|
||||
Columns: []string{roundstats.StatColumn},
|
||||
Table: roundstats.MatchPlayerTable,
|
||||
Columns: []string{roundstats.MatchPlayerColumn},
|
||||
Bidi: false,
|
||||
Target: &sqlgraph.EdgeTarget{
|
||||
IDSpec: &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Column: stats.FieldID,
|
||||
Column: matchplayer.FieldID,
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, k := range nodes {
|
||||
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
||||
}
|
||||
_node.stats_round_stats = &nodes[0]
|
||||
_node.match_player_round_stats = &nodes[0]
|
||||
_spec.Edges = append(_spec.Edges, edge)
|
||||
}
|
||||
return _node, _spec
|
||||
|
Reference in New Issue
Block a user