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

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -