We're Hiring!

Creating a dataset and having OMERO set an automatic id

General and open developer discussion about using OMERO APIs from C++, Java, Python, Matlab and more! Please new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

If you are having trouble with custom code, please provide a link to a public repository, ideally GitHub.

Creating a dataset and having OMERO set an automatic id

Postby icaoberg » Thu Jan 27, 2011 5:21 pm

I know that from script I can do
Code: Select all
dataset = omero.model.DatasetI()
id = 3425235523523
dataset.setId( id )


but is there a way to have omero set this number automatically?
icaoberg
 
Posts: 145
Joined: Fri Sep 17, 2010 9:05 pm
Location: Pittsburgh, PA

Re: Creating a dataset and having OMERO set an automatic id

Postby cxallan » Thu Jan 27, 2011 5:35 pm

It would do so for you if you saved it, yes.
cxallan
Site Admin
 
Posts: 509
Joined: Fri May 01, 2009 8:07 am

Re: Creating a dataset and having OMERO set an automatic id

Postby icaoberg » Thu Jan 27, 2011 5:50 pm

so if i create a dataset and save the dataset, omero will assign an id automatically?
icaoberg
 
Posts: 145
Joined: Fri Sep 17, 2010 9:05 pm
Location: Pittsburgh, PA

Re: Creating a dataset and having OMERO set an automatic id

Postby cxallan » Thu Jan 27, 2011 5:52 pm

Absolutely. It will also guarantee that ID is unique for that OMERO instance.
cxallan
Site Admin
 
Posts: 509
Joined: Fri May 01, 2009 8:07 am


Return to Developer Discussion

Who is online

Users browsing this forum: No registered users and 1 guest