title: Hibernate cant create entity manager factory
body: <p>Hello my spring boot application wont start with MySql database.Maybe my mappings are not OK? </p>
  
  <pre><code>@Entity
  @Table(name = "tweets")
  public class Tweet {
  
      @Id
      @GeneratedValue
      private long tweetId;
  
      @ManyToOne()
      @JoinColumn(name = "user_id", nullable = false)
      private User userId;
  
      @OneToMany(mappedBy = "tweet")
      private Collection&lt;Like&gt; likes;
  
      @Column(nullable = false)
      private String content;
  
      private long score;
  
      public Tweet(){}
  
      public Tweet(User user, String content) {
          this.userId = user;
          this.content = content;
          this.score = 0;
      }
  
      public long getTweetId() {
          return tweetId;
      }
  
      public long getUserId() {
          return userId.getUserId();
      }
  
      public Collection&lt;Like&gt; getLikes() {
          return likes;
      }
  
      public String getContent() {
          return content;
      }
  
      public long getScore() {
          return score;
      }
  }
  </code></pre>
  
  <p>Here is User table: </p>
  
  <pre><code>@Entity
  @Table(name = "Users")
  public class User {
  
      @Id
      @GeneratedValue
      private long userId;
  
      private String email;
  
      @JsonIgnore
      private String password;
  
      private String www;
  
      private String firstName;
  
      private String lastName;
  
      @OneToMany(mappedBy = "userId", fetch = FetchType.EAGER)
      private Collection&lt;Tweet&gt; tweets;
  
      @OneToMany(mappedBy = "userId", fetch = FetchType.EAGER)
      private Collection&lt;Like&gt; likes;
  
      public User() {
      }
  
      public User(User user) {
          this.userId = user.getUserId();
          this.email = user.getEmail();
          this.password = user.getPassword();
          this.www = user.getWww();
          this.firstName = user.getFirstName();
          this.lastName = user.getLastName();
      }
  
  
      public User(String email, String password, String www, String firstName, String lastName) {
          this.email = email;
  //        this.password = BCrypt.hashpw(password,BCrypt.gensalt());
          this.www = www;
          this.firstName = firstName;
          this.lastName = lastName;
      }
  
      public long getUserId() {
          return userId;
      }
  
      public String getEmail() {
          return email;
      }
  
      public String getPassword() {
          return password;
      }
  
      public String getWww() {
          return www;
      }
  
      public String getFirstName() {
          return firstName;
      }
  
      public String getLastName() {
          return lastName;
      }
  
      public Collection&lt;Tweet&gt; getTweets() {
          return tweets;
      }
  
      public Collection&lt;Like&gt; getLikes() {
          return likes;
      }
  
      @Override
      public String toString() {
          return "User{" +
                  "userId=" + userId +
                  ", email='" + email + '\'' +
                  ", password='" + password + '\'' +
                  ", www='" + www + '\'' +
                  ", firstName='" + firstName + '\'' +
                  ", lastName='" + lastName + '\'' +
                  ", tweets=" + tweets +
                  ", likes=" + likes +
                  '}';
      }
  }
  </code></pre>
  
  <p>and here is Like table:</p>
  
  <pre><code>@Entity
  @Table(name = "likes")
  public class Like {
  
      @Id
      @GeneratedValue
      private long likeId;
  
      @ManyToOne()
      @JoinColumn(name = "user_id", nullable = false)
      private User userId;
  
      @ManyToOne()
      @JoinColumn(name = "tweet_id", nullable = false)
      private Tweet tweet;
  
      public Like() {
      }
  
      public Like(User user, Tweet tweet) {
          this.userId = user;
          this.tweet = tweet;
      }
  
      public long getLikeId() {
          return likeId;
      }
  
      public User getUserId() {
          return userId;
      }
  
      public Tweet getTweet() {
          return tweet;
      }
  
      public void setLikeId(long likeId) {
          this.likeId = likeId;
      }
  
      public void setUserId(User userId) {
          this.userId = userId;
      }
  
      public void setTweet(Tweet tweet) {
          this.tweet = tweet;
      }
  }
  </code></pre>
  
  <p>I have to admit that Im a bit confused because Application boots when I'm using H2 database , but I cant get it working with Mysql. The application.properties file is OK, I chcked It with another project where Im having the same config values. </p>
  
  <p>The error is as follows:</p>
  
  <pre><code>Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory
  </code></pre>