Jump to:

23459 Posts in 18906 Topics by 2877 members

General Questions

SilverStripe Forums » General Questions » guid - globally unique identifier

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 363 Views
  • Isidro
    Avatar
    Community Member
    4 Posts

    guid - globally unique identifier Link to this post

    I'm working in a project that uses a mobile app with data that must be sinchronized with a database in SS (few dataobjects).

    In my mobile app, data records use globally unique identifiers as Ids, so i need to define dataobjects in SS also with guids. Can we change SS dataobject behaviour to use guids instead of integers as ID fields? What's the best field type in SS to store guids?

    Has anyone used this datafields that would like to share some experience?

    Regards,
    Rui Isidro

  • Willr
    Avatar
    Forum Moderator
    5497 Posts

    Re: guid - globally unique identifier Link to this post

    Replacing the primary ID in DataObject is likely to be very hard and messy in core. You're best to store the GUID as a new column and simply writing your queries to use that rather than ID field (you can populate the GUID using onBeforeWrite()).

    363 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.