I got the answers from u all regarding the previous topic that was use of hibernate with table not having any primary key, but i have one question that can we use transient keyword prefixed to ID variable in the entity class so that not to persist that value into database???????
Share
No. You must have a persistent ID in all your Hibernate entities. The
transientkeyword is used to avoid serializing it when transferring the object to another JVM (or to a file). The@Transientannotation is used to mark a field not persistent, but it can’t be used for the ID, which is absolutely necessary in order to use Hibernate.