在利用hibernate 自动建表,在Po中通过注解配置的一个@ManyToOne,在自动生成的表中的字段类型是Blob类型的,数据库用的mysql;
@Entity
@Table
public class User{
@Id
private int id;
@ManyToOne
private Book book;
//getter and setter..
}
@Entity
@Table
public class Book{
@Id
private int id;
private String name;
//getter and setter..
}
HibernateMySQLentity
@Entity
@Table
public class User{
@Id
private int id;
@ManyToOne
private Book book;
//getter and setter..
}
@Entity
@Table
public class Book{
@Id
private int id;
private String name;
//getter and setter..
}
HibernateMySQLentity
@ManyToOne对应的列的类型是blob 类型不是 int 型