My goal is to create an entity Device that has a unique field IMEI and I would like to use it as a primary key, and specify it at device registration time (manually specifie
@GeneratedValue(strategy = GenerationType.AUTO) cannot be used with String type. So, if you want to use String as ID, you have to assign it manually. But it is fine to use String as ID if it suits your need.
Using org.hibernate.id.Assigned also means that you have to assign the ID value before saving the data.
When @GeneratedValue annotation is not added, the default is assigned generator which means the value of identifier has to be set by the application.
Please refer to the hibernate manual for details.