Within my REST controler the function new, where I am able to do a post, has the default scaffolded code
classService.saveClass(class);
return classDAO.findClassByPrimaryKey(class.getClassId());
Unfortunately it is returning null, although the save is working.
The only thing I can think of is the way I have set up the setting of the unique id (which almost certainly means this will have nothing to do with it)
It is an SQL table with the usual integer primary key, set to auto-increment.
Scaffolded in the usual way. Added
@GeneratedValue(strategy = GenerationType.AUTO)
to the field in the domain class, which enables the serviceImpl.classSave() function to run without a message asking to set the key manually.
Can anyone assist?
Regards