Hibernate is new here. I am working on a simple Hibernate mapping file. When I use the xml approach, I set the generator class for assignment. There is a certain logic that needs to be checked before assigning an employee identifier, so I cannot generate it automatically.
<id name="id" type="string" column="emp_id">
<generator class="assigned">
</generator>
</id>
But I am also studying the type of annotation, and the annotation seems to be underway now when the scope moves away from configuration files. But I can not find the type of generation according to the assigned value
public class Employee{
String id;
@column(name="emp_id", unique=true)
public String getID(){
return id;
}
}
Does this mean that I do not need to add a sequence generator annotation when it is assigned? Thanks
source
share