1
votes

Full error is `Unable to execute schema management to JDBC target [create table DocumentValidation (id bigint not null auto_increment, key varchar(255), value varchar(255), documentDetail_id bigint, primary key (id))]

aused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar(255), value varchar(255), documentDetail_id bigint, primary key (id))'

The entity

@Entity
public class DocumentDetail {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;


//no cascade, a connectionManager save/update cant save/update a  a credential
//unidirectional mapping,
@OneToOne
@JoinColumn(name= "credential_id")
private Credential credential;

@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
@JoinColumn(name = "documentDetail_id")
private List<DocumentValidation> documentValidationList;

public enum DocumentLocationType {
    Confluence, DocumentCentral, FileShare, OneDrive, SharePoint
};

@Enumerated(EnumType.STRING)
private DocumentLocationType locationType;

private String locationUrl;
1

1 Answers

1
votes

The error refers to your DocumentValidation entity:

Unable to execute schema management to JDBC target [create table DocumentValidation (id bigint not null auto_increment, key varchar(255), value varchar(255), documentDetail_id bigint, primary key (id))]

Please look at your column: key varchar(255)

key word cannot be used for column name - this causes your syntax error.