func (swfsc *SurveyWiFiScanCreate) Save(ctx context.Context) (*SurveyWiFiScan, error) {
	if swfsc.create_time == nil {
		v := surveywifiscan.DefaultCreateTime()
		swfsc.create_time = &v
	}
	if swfsc.update_time == nil {
		v := surveywifiscan.DefaultUpdateTime()
		swfsc.update_time = &v
	}
	if swfsc.bssid == nil {
		return nil, errors.New("ent: missing required field \"bssid\"")
	}
	if swfsc.timestamp == nil {
		return nil, errors.New("ent: missing required field \"timestamp\"")
	}
	if swfsc.frequency == nil {
		return nil, errors.New("ent: missing required field \"frequency\"")
	}
	if swfsc.channel == nil {
		return nil, errors.New("ent: missing required field \"channel\"")
	}
	if swfsc.strength == nil {
		return nil, errors.New("ent: missing required field \"strength\"")
	}
	if len(swfsc.survey_question) > 1 {
		return nil, errors.New("ent: multiple assignments on a unique edge \"survey_question\"")
	}
	if len(swfsc.location) > 1 {
		return nil, errors.New("ent: multiple assignments on a unique edge \"location\"")
	}
	return swfsc.sqlSave(ctx)
}
// Save creates the SurveyWiFiScan in the database.
Save creates the SurveyWiFiScan in the database.
// Save creates the SurveyWiFiScan in the database .
func (swfsc *SurveyWiFiScanCreate) Save(ctx context.Context) (*SurveyWiFiScan, error) {
	if swfsc.create_time == nil {
		v := surveywifiscan.DefaultCreateTime()
		swfsc.create_time = &v
	}
	if swfsc.update_time == nil {
		v := surveywifiscan.DefaultUpdateTime()
		swfsc.update_time = &v
	}
	if swfsc.bssid == nil {
		return nil, errors.New("ent: missing required field \"bssid\"")
	}
	if swfsc.timestamp == nil {
		return nil, errors.New("ent: missing required field \"timestamp\"")
	}
	if swfsc.frequency == nil {
		return nil, errors.New("ent: missing required field \"frequency\"")
	}
	if swfsc.channel == nil {
		return nil, errors.New("ent: missing required field \"channel\"")
	}
	if swfsc.strength == nil {
		return nil, errors.New("ent: missing required field \"strength\"")
	}
	if len(swfsc.survey_question) > 1 {
		return nil, errors.New("ent: multiple assignments on a unique edge \"survey_question\"")
	}
	if len(swfsc.location) > 1 {
		return nil, errors.New("ent: multiple assignments on a unique edge \"location\"")
	}
	return swfsc.sqlSave(ctx)
}
func ( swfsc * SurveyWiFiScanCreate ) Save ( ctx context . Context ) ( * SurveyWiFiScan , error ) { if swfsc . create_time == nil { v := surveywifiscan . DefaultCreateTime ( ) swfsc . create_time = & v } if swfsc . update_time == nil { v := surveywifiscan . DefaultUpdateTime ( ) swfsc . update_time = & v } if swfsc . bssid == nil { return nil , errors . New ( " \" \" " ) } if swfsc . timestamp == nil { return nil , errors . New ( " \" \" " ) } if swfsc . frequency == nil { return nil , errors . New ( " \" \" " ) } if swfsc . channel == nil { return nil , errors . New ( " \" \" " ) } if swfsc . strength == nil { return nil , errors . New ( " \" \" " ) } if len ( swfsc . survey_question ) > 1 { return nil , errors . New ( " \" \" " ) } if len ( swfsc . location ) > 1 { return nil , errors . New ( " \" \" " ) } return swfsc . sqlSave ( ctx ) }
Save creates the SurveyWiFiScan in the database.
Save creates the SurveyWiFiScan in the database .