Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question



I am confused by the documentation for @SpaceId. The documentation I am referring to is at:


Under "Filed Level Decoration @SpaceId" the doc. says:

autoGenerate boolean Specifies if the object UID is generated automatically by the space when written into the space. If false, the field is indexed automatically, and if true, the field isn't indexed

This surprises me for two reasons. First, it SUGGESTS that a value of true means "no auto-generation" which is counterintuitive. Second, it SEEMS TO SAY that this boolean controls indexing on the field, which doesn't sound right.

Then under "POJO UID Generation and Usage Scenarios" on the same page, the doc. says:

When a POJO object has a property which is declared as SpaceId and marked as auto-generate=false, the UID is generated using the ClientUIDHandler utility class.

When a POJO 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 java.lang.String type.

This is more what I would expect.

Perhaps this is a simple documentation error, or it could well be that my understanding of @SpaceId is very poor. Either way, I would appreciate your insight.

Many thanks.


{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=2769]{quote}

asked 2008-12-17 05:51:05 -0500

subuta gravatar image

updated 2013-08-08 09:52:00 -0500

jaissefsfex gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

auto-generate=false means the internal space UID for the object is generated using the ClientUIDHandler utility class based on the value within the annotated field. This means u can later retrieve the object based on its ID. In this case u must have a value within this field before writing it into the space.

auto-generate=true means the internal space UID for the object is auto generated once the object is written into the space. In this case u are not allowed to have any value within this field.

We will make the doc more clear.

Let me know if this helps.


answered 2008-12-17 08:11:19 -0500

shay hassidim gravatar image
edit flag offensive delete link more


Hi Shay,

That help. Thanks.


subuta gravatar imagesubuta ( 2008-12-17 11:39:54 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2008-12-17 05:51:05 -0500

Seen: 304 times

Last updated: Dec 17 '08