hi! How does servoy uuid generator work? Will it not generate “_” as part of the id? Why does it need 36 in text size?
Rogel,
You can use text(36) or media(16) column types with UUID in Servoy.
In case of text, the dashes are also in the data, it is just the string representation of the UUID.
Note that you have to set the UUID flag on the column in the table editor.
Rob
rgansevles:
Rogel,You can use text(36) or media(16) column types with UUID in Servoy.
In case of text, the dashes are also in the data, it is just the string representation of the UUID.
Rob
How about other special characters like underscores “_”, slashes"/ or ". Is it possible that these characters be in the generated uuid as well?
Note that you have to set the UUID flag on the column in the table editor.
The foreign key column should have its UUID flag set as well?
Rogel,
We use the standard java UUID generator which generates type 4: http://en.wikipedia.org/wiki/Universall … identifier
The UUID flag has to be set on all columns that contain UUID, so also fk.
Rob
rgansevles:
Rogel,We use the standard java UUID generator which generates type 4: http://en.wikipedia.org/wiki/Universall … identifier
The UUID flag has to be set on all columns that contain UUID, so also fk.
Rob
Thanks Rob.
What will happen to my existing data? We shifted from Integer to Text and Servoy Sequence to UUID. I believe loadRecords() will not work. If I replace it with application.getUUID(), it does not work as well? What if other systems place data into our database and we would like to retrieve the records in our system.
The solution that I think is…
pkcolumn will remain text
pkcolumn sequence type is blank
for every new record, set the primary key column to application.getUUID()
is there another servoy way to accomplish this?
Rogel,
I don’t understand what you are trying to do.
You had a pk int-servoyseq and you replaced that with text-uuidgenerator?
In that case loadRecords(uuid) should work.
Obviously, you cannot retrieve the records by old pk since (i guess) all numeric pks are replaced with a uuid value.
If other systems put data with uuids in your system, that should be fine, same as for any other key type.
Rob
rgansevles:
Rogel,I don’t understand what you are trying to do.
You had a pk int-servoyseq and you replaced that with text-uuidgenerator?
In that case loadRecords(uuid) should work.
Obviously, you cannot retrieve the records by old pk since (i guess) all numeric pks are replaced with a uuid value.If other systems put data with uuids in your system, that should be fine, same as for any other key type.
Rob
e.g.
website
id="37F3CB42-26FC-4CE3-935F-3E804044B719"
value="www.yahoo.com"
id="1" <-- existing record before changing int-servoyseq to text-uuidgenerator
value="www.google.com"
in my code ```
loadRecord(application.getUUID(“1”))
application.getUUID() converts the parameter (that can be string or byte array) to an UUID object.
It can’t do that for value “1”.
Rob