Question: I have an entity called Task and it has taskId field. Problem is I need to create/update some specific tasks and JPA autogenerator doesn't allow me to set taskId manually.(It overrides my taskId) 

Is there any way to set taskId manually?

```
@Id
@Column(name = "task_id")
@GeneratedValue(generator = "system-uuid")
@GenericGenerator(name = "system-uuid", strategy = "org.hibernate.id.UUIDGenerator")
private String taskId;

```

Answer: 
Using

```
@GeneratedValue(strategy = GenerationType.IDENTITY)

```

Example:
<http://www.codejava.net/frameworks/hibernate/java-hibernate-jpa-annotations-tutorial-for-beginners>
[This link](https://stackoverflow.com/questions/18182826/set-id-pk-generation-value-auto-and-manual)
may help you.

I would apply a basic solution if I understood your problem correctly.

```
@Column(name = "task_id", unique = true, nullable = false)
private String taskId;

```