I am creating a DAO of the User entity. I'm doing the save method, I'd like it to return the created object or the id of the created object. Similar to JPARepository's saveAndFlush. Below is the code for the save method of the UserDAO class:

```
        public long save(User newUser) {
        String query = "insert into user (email,password,name,tenant) values(?,?,?,?) returning id";
        TypedQuery<Usuario> q = em.createQuery(query, User.class);

        q.setParameter(1, newUser.getCredencials().getEmail())
                .setParameter(2, newUser.getCredenciaals().getPassword()).setParameter(3, newUser.getName())
                .setParameter(4, newUser.getTenant());
        Usuario userSave = q.getSingleResult();
        long id = userSave.getId();
        return userSave;
}

```

My code is not running. You are experiencing the following errors on the console:

```
antlr.NoViableAltException: unexpected token: values
org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: values near line 1, column 47 [insert into usuario (email,senha,nome,tenant) values(?,?,?,?) returning id]

```

Please help me to find the code error.