一个pojo Position,使用Daos.createTablesInPackage(dao, "com.xx.pojo", false) 自动建表,有些表可以自动建好,
import org.nutz.dao.entity.annotation.Id;
import org.nutz.dao.entity.annotation.Name;
import org.nutz.dao.entity.annotation.Table;
@Table
public class Position {
@Id
private int id;
@Name
private String name;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
出错信息
Caused by: org.nutz.dao.DaoException: !Nutz SQL Error: 'CREATE TABLE position(
id INT(32) AUTO_INCREMENT,
name VARCHAR(128) UNIQUE NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB CHARSET=utf8'
PreparedStatement:
'CREATE TABLE position(
id INT(32) AUTO_INCREMENT,
name VARCHAR(128) UNIQUE NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB CHARSET=utf8'
CaseMessage=You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'position(
id INT(32) AUTO_INCREMENT,
name VARCHAR(128) UNIQUE NOT NULL,
PRIMARY ' at line 1
这个语句很简单,在phpmyadmin里面运行该语句,同样报错,但,把“CREATE TABLE position(” 改成“CREATE TABLE position (”,就可以运行了,只是在position后面加了个空格,请问如何修改,才能继续自动建表?谢谢!