java - Hibernate String Primary Key with Annotation -


I am trying to create a priority class with an annotation whose primary key is inserting the string, I will assign from Therefore there is no need for hibernate to generate value for it. I'm trying to do something like this:

  @ id @ generatedValue (generator = "assigned") @ column (name = "ROLE_NAME", nullable = false) Private string role name ;   

but throws exceptions with:

  by reason: org.hibernate.AnnotationException: unknown Id.generator: specified   

How do I configure a string primary key with annotations?

Since roleName is not auto-generated, @ generatedValue : "" ROLE_NAME ", nullable = false) Private string roles;

Comments

Popular posts from this blog

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

Pygame memory leak with transform.flip -

python - Writing Greek in matplotlib labels, titles -