func (fpc *FloorPlanCreate) Save(ctx context.Context) (*FloorPlan, error) {
	if fpc.create_time == nil {
		v := floorplan.DefaultCreateTime()
		fpc.create_time = &v
	}
	if fpc.update_time == nil {
		v := floorplan.DefaultUpdateTime()
		fpc.update_time = &v
	}
	if fpc.name == nil {
		return nil, errors.New("ent: missing required field \"name\"")
	}
	if len(fpc.location) > 1 {
		return nil, errors.New("ent: multiple assignments on a unique edge \"location\"")
	}
	if len(fpc.reference_point) > 1 {
		return nil, errors.New("ent: multiple assignments on a unique edge \"reference_point\"")
	}
	if len(fpc.scale) > 1 {
		return nil, errors.New("ent: multiple assignments on a unique edge \"scale\"")
	}
	if len(fpc.image) > 1 {
		return nil, errors.New("ent: multiple assignments on a unique edge \"image\"")
	}
	return fpc.sqlSave(ctx)
}
// Save creates the FloorPlan in the database.
Save creates the FloorPlan in the database.
// Save creates the FloorPlan in the database .
func (fpc *FloorPlanCreate) Save(ctx context.Context) (*FloorPlan, error) {
	if fpc.create_time == nil {
		v := floorplan.DefaultCreateTime()
		fpc.create_time = &v
	}
	if fpc.update_time == nil {
		v := floorplan.DefaultUpdateTime()
		fpc.update_time = &v
	}
	if fpc.name == nil {
		return nil, errors.New("ent: missing required field \"name\"")
	}
	if len(fpc.location) > 1 {
		return nil, errors.New("ent: multiple assignments on a unique edge \"location\"")
	}
	if len(fpc.reference_point) > 1 {
		return nil, errors.New("ent: multiple assignments on a unique edge \"reference_point\"")
	}
	if len(fpc.scale) > 1 {
		return nil, errors.New("ent: multiple assignments on a unique edge \"scale\"")
	}
	if len(fpc.image) > 1 {
		return nil, errors.New("ent: multiple assignments on a unique edge \"image\"")
	}
	return fpc.sqlSave(ctx)
}
func ( fpc * FloorPlanCreate ) Save ( ctx context . Context ) ( * FloorPlan , error ) { if fpc . create_time == nil { v := floorplan . DefaultCreateTime ( ) fpc . create_time = & v } if fpc . update_time == nil { v := floorplan . DefaultUpdateTime ( ) fpc . update_time = & v } if fpc . name == nil { return nil , errors . New ( " \" \" " ) } if len ( fpc . location ) > 1 { return nil , errors . New ( " \" \" " ) } if len ( fpc . reference_point ) > 1 { return nil , errors . New ( " \" \" " ) } if len ( fpc . scale ) > 1 { return nil , errors . New ( " \" \" " ) } if len ( fpc . image ) > 1 { return nil , errors . New ( " \" \" " ) } return fpc . sqlSave ( ctx ) }
Save creates the FloorPlan in the database.
Save creates the FloorPlan in the database .