Questions tagged [id-generation]

81 questions
0
votes
1 answer

Does the path of a Document have any bearing on the random ID auto-generated by Firestore?

If I want to know the (random) ID of a document before saving it to Firestore (without writing custom code), I can do the following: String id = db.collection("collection-name").document().getId(); Does it make a difference if I give…
markvgti
  • 4,321
  • 7
  • 40
  • 62
0
votes
0 answers

hazelcast flake id returns different data

I am trying to use the flake id instead of sequence in the database so that I can use the write-behind persistence mechanism. However I am getting this weird error where when I return the id as json the id changes but from postman it is fine. Cache…
Pilo
  • 15
  • 3
0
votes
1 answer

If we are using `identity` ID Generator and still we set the primary key to the entity object then which primary key will be stored in the database?

As we know if we use identity ID Generator in Hibernate and if we dont set the primary key value to the entity object then database will insert the primary key value. But If we are using identity ID Generator and still we set the primary key value…
0
votes
1 answer

Generating custom object identifiers using Hibernate

I have the following classes. StockId class represents the Id of the Stock class. The stock class represents the following table: CREATE TABLE stock (id NUMBER(10), stock_code VARCHAR2(30), stock_name VARCHAR2(100), CONSTRAINT pk_stock PRIMARY KEY…
kaushik
  • 2,308
  • 6
  • 35
  • 50
0
votes
1 answer

snowflake: "left shift" made that result exceeds long.max value

((timestamp - 1288834974657) << 32) I included some more bits information, for example, total 32 bits after timestamp information needs, then the timestamp needs to be left shift 32 bits, such that the result exceeds long.max value. The result…
Lander
  • 11
  • 2
0
votes
1 answer

ID Generation from 16 digit number

Are there any possible simple methods/ways to generate/encrypt a 16 digit alpha-number into a 6 to 8 digit alpha-numeric code. There will be millions of possible combinations of the 16 digit number, so the encrypted 6-8 alpha-numeric number has to…
0
votes
0 answers

JPA auto generated ids of inherited entities not incremented as defined in sequence generator in super class

I have a strange behavior of auto generation id on persisting inherited entities. I have a person entity with sequence generator which increments by 4 and it works fine. I have two other entities Client and Agent which inherit Person and use the…
0
votes
0 answers

Check @Id column value against database before persisting

Below is my Primary column definition, @Id @GenericGenerator(name = "kaugen", strategy = "increment") @GeneratedValue(generator = "kaugen") private Long entityId; @Version @Column(unique = false, updatable = true, nullable = false) @NotNull private…
0
votes
1 answer

Spring Data CrudRepository custom ID generator

I am using spring boot(1.4),spring data and jpa. And using @Repository(CrudRepository) One of my Table/Entity, the ID column, I want to generate customised string. Start with some specific string plus creation data and time, and end with next value…
Manu
  • 1,243
  • 5
  • 17
  • 43
0
votes
2 answers

How generate ID or Class for div?

There is PHP code that when User click on the_title(); then the_content will be emerged. My problem is that if there are unlimited the_title(); and the_content();, there is problem with generating ID that it must be unique. How can i generate for…
Hamed
  • 565
  • 3
  • 17
0
votes
0 answers

Customizing featureID generation in Geoserver

I would like know if it is possible to customize the featureID (fid) generation while performing WFS-T. I looked into the option of specifying "UseExisting" value for the idgen, however, we would not want the user to specify the gml:id…
myspri
  • 283
  • 7
  • 14
0
votes
0 answers

Lock mysql database, when insert data more than one user at one time

I'm creating an application using Java RMI. In my case, more than 10 users are adding data to the database. My application has a class GenerateID and it's on server side. For every user's id generation process is going through this class. It has a…
hump
  • 53
  • 10
0
votes
2 answers

why is my appengine IdGeneratorStrategy generating huge numbers?

I just moved my code from one machine to another, released it and suddenly it created an entry with a key of "576728208506880" so I re-released the exact same code from the original machine and created another field and this time the key created was…
johnvdenley
  • 739
  • 1
  • 7
  • 16
0
votes
0 answers

@GeneratedValue(strategy=GenerationType.AUTO) does not create id for embedded setup

I have the following database setup using Spring and Hibernate as JPA implementor. I have a entity class extending org.springframework.data.jpa.domain.AbstractPersistable which basically defines an id attribute with a generation strategy of AUTO. If…
Jonas Geiregat
  • 5,214
  • 4
  • 41
  • 60
0
votes
0 answers

Has anything changed in mongodb c# driver for how to register an IIdGenerator?

I am currently trying to update my mongocsharpdriver package from version from 1.5 to 1.8.3. However my custom IdGenerator has stopped working with the upgrade. The code I am using (with StructureMap) to register my id generator for all Ids of type…
Saan
  • 544
  • 5
  • 19