简体   繁体   English

Flex中的Null整数

[英]Null integers in Flex

My database field is as is: num_in_stock, mediumint(8), NULL (yes)我的数据库字段是:num_in_stock,mediumint(8),NULL(是)

I'm generating my services using the Connect to Data/Service tool in Flash Builder 4我正在使用 Flash Builder 4 中的连接到数据/服务工具生成我的服务

What is the best course of action if I want my num_in_stock field to have a value of NULL, not zero (0) when we leave the field empty?如果我希望我的 num_in_stock 字段的值为 NULL,而不是在我们将该字段留空时为零 (0),那么最好的做法是什么?

Thanks!谢谢!

In Flash, you can't have an int as null.在 Flash 中,不能将 int 作为 null。 int and uint default to 0. Number however defaults to NaN. int 和 uint 默认为 0。但 Number 默认为 NaN。 You could always convert your int to Number before it's sent over to Flash and make sure it's NaN.在将 int 发送到 Flash 之前,您始终可以将其转换为 Number 并确保它是 NaN。 However, this would depend on your data transportation protocol (amf, json, etc..)但是,这取决于您的数据传输协议(amf、json 等。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM