The warning is not related to using @GeneratedValue in a class that has only one id field. A warning about using @GeneratedValue in one column of a composite key, which is a very strange use case (I have never seen the need for something like this for 12 years).
So, a warning: if you need to use @GeneratedValue in a composite key, then look at your model, because there is a high probability that something is wrong with it.
If you think this does not answer your question, can you give an example where you might need this function?
source share