XAP

Space Object ID

How Space Object ID is Generated?

You can insert an object into the space using the Write() and WriteMultiple() methods. When a new object is inserted into the space, it embeds a unique ID - called the UID. The UID can be generated explicitly by the client using a unique value generated by the application business logic or using a sequencer running within the space.

The space UID for space object can be created in three different ways:

  • When a space object has no SpaceId property declared, the space generates a UID for the object.
  • When a space object has a property which is declared as SpaceId and marked as auto-generate=false, the UID is generated based on the value of the ID field the user is setting.
  • When a space object has a property which is declared as SpaceId and marked as auto-generate=true, the UID is generated by the space and placed back into the field using the relevant setter method. In this case, the field must be a String type.

The SpaceId Field content

  • When a space Class has no SpaceId property declared, it will be returned without any ID. This means that update operations cannot be executed on the space Class. Only the Read() and Write() methods can be executed.
  • When a space Class has a property which is declared as SpaceId and auto-generate=true and its value is null, the SpaceId field will store the ID.
  • When a space Class has a property which is declared as SpaceId and auto-generate=true and its value is not null, the SpaceId field will store the original value stored within the SpaceId field.
  • When a space Class has a property which is declared as SpaceId and auto-generate=false, the SpaceId field will store the original value stored within the SpaceId field used to generate the UID.