For me with postgres, this worked fine:
Long nextValue = session.createNativeQuery("select nextval('seq_name')", Long.class) .getSingleResult()