我正在尝试使用springboot Entity
类创建注册表
//this is entity class
@Entity
@Table(name="RegsitrationPage")
public class Register {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(name="reg_id")
private long regId;
@Enumerated(EnumType.ORDINAL)
@Column(name="account_Type")
private AccountType acountype;
@Column(name="first_Name")
private String firstName;
@Column(name="last_Name")
private String lastName;
@NumberFormat
@Column(name="mobile_Number")
private long mobileNumber;
@Temporal(TemporalType.DATE)
@Column(name="date_Of_Birth")
private Date dateOfBirth;
@Enumerated(EnumType.STRING)
@Column(name="Gender")
private Gender gender;
@Email
@Column(name="email",unique=true)
private String email;
@Column(name="password")
private String password;
@Column(name="confirm_Password")
private String confirmPassword;
@Column(name="address_Line")
private String addressLine;
@Column(name="city")
private String city;
@Column(name="state")
private String state;
@Column(name="country")
private String Country;
@Column(name="Pincode")
private int pincode;
@Column(name="photo_Id_proof")
private String PhotoIdProof;
@Column(name="photo_Id_Card-Number")
private String photoIdCardNumber;
@Column(name="institution_Type")
private String institutionType;
@Column(name="institution_Name")
private String institutionName;
@Column(name="upload_photo")
private String uploadPhoto;
//constructor and getters and setters are created here
}
我已经更新了Maven并运行在控制台中出现错误的应用程序
您的SQL语法有错误;检查与您的MariaDB服务器版本相对应的手册以获取正确的语法,以在第1行附近使用'-number varchar(255),pincode integer,state varchar(255),upload_photo varchar(')
伴随此错误
Error creating bean with name 'entityManagerFactory' defined in class path
resource
[org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.c
lass]: Invocation of init method failed; nested exception is
javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Unable to execute schema management to JDBC target [create table regsitration (reg_id bigint not null auto_increment, photo_id_proof varchar(255), account_type integer, address_line varchar(255), city varchar(255), confirm_password varchar(255), country varchar(255), date_of_birth date, email varchar(255), first_name varchar(255), gender varchar(255), institution_name varchar(255), institution_type varchar(255), last_name varchar(255), mobile_number bigint, password varchar(255), photo_id_card-number varchar(255), pincode integer, state varchar(255), upload_photo varchar(255), primary key (reg_id)) ENGINE=InnoDB]