facebook

new Rest function returns null

  1. MyEclipse IDE
  2.  > 
  3. Spring Development
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #320351 Reply

    Greg Soulsby
    Member

    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

Viewing 1 post (of 1 total)
Reply To: new Rest function returns null

You must be logged in to post in the forum log in