Thursday 24 November 2011

JPA/SQL: a column cannot have the name "references"

If a column has the name "references" then I cannot create the table....Obviously it's illegal! Why??? Is there any conflict with foreign keys?? Updated: 4 Dec 2011 For example the Java code
private String references;
public String getReferences() {
  return references;
}
public void setReferences(String references) {
  this.references = references;
}
translates into the following SQL:
create table ...,references varchar(255),
and MySLQ thinks that the column is a Foreign Key...which is invalid syntax... In order to solve this just rename references into (eg) ref

No comments:

Post a Comment