User object in hibernate 5.3 obj mapping

I'm working on a project using Hibernate 5.3 and am having an issue with a use case like the following. If I'm writing a simple blog application and I have obj's like the following:

@Entity
public class Post {
    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    private int id;

    private User author;
    private String text;

    // getters, setters omitted
}

and a user obj

@Entity
public class User {
    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    private int id;

    private String name;
    private String email;

    // getters, setters omitted
}

and then in a DAO I want to do something like:

public void savePost(Post post) {
  if (post.getUser.isLoggedOn()) {
     // code for saving
  }
}

is that the best way, or is it better to do something like:

public void savePost(Post post, User user) {
  if (user.isLoggedOn()) {
     // code for saving
  }
}

and just have a authorId as a field in the Post class as opposed to a User ojb?

many of the searches I looked at linked to older versions of hibernate which appear to be quite different from hibernate 5, so not sure how much crossover there is.