allocate_ids函數是否總是返回正值? 或者它可以有時返回負值或零值嗎?allocate_id總是返回正值嗎?
0
A
回答
0
在谷歌組評論人稱爲Stephen說關於db.model
:
IDs are 64bit positive integers. If you allocate IDs for an entity called 'Sequence' you can use them for any other entity kind, including entities with parents which would otherwise use a unique range if auto allocated. IDs from 'Sequence' will be unique within your datastore, which is a superset of the requirement that IDs be unique per-entity group. However, you must always then use an ID from Sequence and never allow auto-allocation.
他似乎知道他在說什麼。我無法找到另一個對數據存儲的自動ID序列發生器,但在這種類似question這裏的allocateids java的定義被鏈接到和它說,它可以拋出這個錯誤:
java.lang.IllegalArgumentException - If parent is not a complete key, if num is less than 1, or if num is greater than 1 billion.
相關問題
- 1. 返回值總是暫時的嗎?
- 2. 減號操作總是返回正值
- 3. Textbox.Text.GetTypeCode()總是返回「string」嗎?
- 4. 總是返回零值
- 5. DataTable總是返回空值
- 6. SharedPreferences值總是返回true?
- 7. getRingerMode()總是返回值0
- 8. linq2sql表達式總是返回IQueryable嗎?
- 9. COUNT(*)總是返回結果嗎?
- 10. GetBodyCount()在Box2d中總是返回0嗎?
- 11. RInterface.GetArrayToVBA()總是返回一個數組嗎?
- 12. 總是返回功能明智嗎?
- 13. RegDBKeyExists總是返回-1(不正確)
- 14. 使用ActiveRecord時,應該總是檢查「save」的返回值嗎?
- 15. Oracle dbms_utilities.get_hash_value總是爲不同的輸入返回唯一值嗎?
- 16. 返回值0總是在存儲過程中成功嗎?
- 17. isItemChecked總是返回與onItemClickListener內部應該相反的值嗎?
- 18. Random.Next返回總是相同的值
- 19. getIntExtra總是返回默認值
- 20. 布爾值總是返回false
- 21. javascript的返回值總是未定義
- 22. Angular2 Click方法總是返回假值
- 23. Random.Next總是返回相同的值
- 24. localtimestamp總是返回相同的值
- 25. Random.Next()總是返回相同的值
- 26. wifi getLinkSpeed()總是返回一個值
- 27. 函數總是返回相同的值
- 28. UUID.randomUUID()。getLeastSignificantBits()總是返回負值?
- 29. 返回值:: EXEC(總是QDialog的::拒絕
- 30. Geocoder並不總是返回值
嗨,保羅。感謝您的幫助。我明白它不應該返回負數或零數字。 – hogedigo 2013-02-27 00:21:39
第二個引用超出了上下文 - 它並沒有引用該ID,而是指定了該參數應該返回多少個ID。還要注意,生成的ID現在限制爲53位,以便與js整數一起使用。 – Tom 2014-07-18 17:25:34