Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- spring.data.jpa.repositories.enabled=true
- spring.datasource.driver-class-name=com.mysql.jdbc.Driver
- spring.datasource.url=jdbc:mysql://localhost/project_db?user=root&password=root
- spring.jpa.generate-ddl=true
- spring.jpa.hibernate.ddl-auto=update
- spring.jpa.show-sql = true
- spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
- public enum Roles implements Serializable {
- ROLE_USER,
- ROLE_ADMIN
- }
- @Id
- @GeneratedValue(strategy = GenerationType.IDENTITY)
- @Column(name = "id")
- private Long Id;
- @Basic
- @Column(name = "username")
- private String username;
- @Basic
- @Column(name = "password")
- private String password;
- @Basic
- @Column(name = "fullname")
- private String fullName;
- @ElementCollection(targetClass = Roles.class, fetch = FetchType.EAGER)
- @Enumerated(EnumType.STRING)
- @JoinTable(name = "user_roles", joinColumns = @JoinColumn(name = "user_id", referencedColumnName = "id"))
- private Set<Roles> roles;
- Hibernate: insert into users (fullname, password, username) values (?, ?, ?)
- Hibernate: insert into user_roles (user_id, roles) values (?, ?)
- `javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not prepare statement
- Caused by: org.hibernate.exception.GenericJDBCException: could not prepare statementce.PersistenceException:
- Caused by: java.sql.SQLException: ConnectionImple.registerDatabase - ARJUNA017017: enlist of resource failed
- com.mysql.jdbc.jdbc2.optional.MysqlXAException: No operations allowed after connection closed.
- java.sql.SQLException: ConnectionImple.registerDatabase - ARJUNA017017: enlist of resource failed
- com.mysql.jdbc.jdbc2.optional.MysqlXAException: No operations allowed after connection closed.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement