func (stqc *SurveyTemplateQuestionCreate) Save(ctx context.Context) (*SurveyTemplateQuestion, error) {
	if stqc.create_time == nil {
		v := surveytemplatequestion.DefaultCreateTime()
		stqc.create_time = &v
	}
	if stqc.update_time == nil {
		v := surveytemplatequestion.DefaultUpdateTime()
		stqc.update_time = &v
	}
	if stqc.question_title == nil {
		return nil, errors.New("ent: missing required field \"question_title\"")
	}
	if stqc.question_description == nil {
		return nil, errors.New("ent: missing required field \"question_description\"")
	}
	if stqc.question_type == nil {
		return nil, errors.New("ent: missing required field \"question_type\"")
	}
	if stqc.index == nil {
		return nil, errors.New("ent: missing required field \"index\"")
	}
	if len(stqc.category) > 1 {
		return nil, errors.New("ent: multiple assignments on a unique edge \"category\"")
	}
	return stqc.sqlSave(ctx)
}
// Save creates the SurveyTemplateQuestion in the database.
Save creates the SurveyTemplateQuestion in the database.
// Save creates the SurveyTemplateQuestion in the database .
func (stqc *SurveyTemplateQuestionCreate) Save(ctx context.Context) (*SurveyTemplateQuestion, error) {
	if stqc.create_time == nil {
		v := surveytemplatequestion.DefaultCreateTime()
		stqc.create_time = &v
	}
	if stqc.update_time == nil {
		v := surveytemplatequestion.DefaultUpdateTime()
		stqc.update_time = &v
	}
	if stqc.question_title == nil {
		return nil, errors.New("ent: missing required field \"question_title\"")
	}
	if stqc.question_description == nil {
		return nil, errors.New("ent: missing required field \"question_description\"")
	}
	if stqc.question_type == nil {
		return nil, errors.New("ent: missing required field \"question_type\"")
	}
	if stqc.index == nil {
		return nil, errors.New("ent: missing required field \"index\"")
	}
	if len(stqc.category) > 1 {
		return nil, errors.New("ent: multiple assignments on a unique edge \"category\"")
	}
	return stqc.sqlSave(ctx)
}
func ( stqc * SurveyTemplateQuestionCreate ) Save ( ctx context . Context ) ( * SurveyTemplateQuestion , error ) { if stqc . create_time == nil { v := surveytemplatequestion . DefaultCreateTime ( ) stqc . create_time = & v } if stqc . update_time == nil { v := surveytemplatequestion . DefaultUpdateTime ( ) stqc . update_time = & v } if stqc . question_title == nil { return nil , errors . New ( " \" \" " ) } if stqc . question_description == nil { return nil , errors . New ( " \" \" " ) } if stqc . question_type == nil { return nil , errors . New ( " \" \" " ) } if stqc . index == nil { return nil , errors . New ( " \" \" " ) } if len ( stqc . category ) > 1 { return nil , errors . New ( " \" \" " ) } return stqc . sqlSave ( ctx ) }
Save creates the SurveyTemplateQuestion in the database.
Save creates the SurveyTemplateQuestion in the database .