'How to save without using autogenerated in JPA?

I am using oracle database with JPA, I have an id column this is not auto generated type. While performing saveAll() operation we are getting - ids for this class must be manually assigned before calling save(): This is Id i am getting form some other table

@Entity
@Table(name = "area_usr")
public class AreaUsr {

    @Id
    private Integer usrId;
    private String area;
    //getter setter
}
List<AreaUsr> au = xyzRepo.getAreaInfo();
areaUsrRepo.saveAll(au); // here i am getting the error


Solution 1:[1]

Because ids can't be null ,and since it's not auto generated ,it must be specified before getting persisted.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 karim farhouti