要求是用户可以写一篇文章,因此我选择类型Text为mysql数据库内的内容字段。如何将Java字符串转换为MySQL文本
在这里你去吉姆坚
@Entity
public class Article implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private Long userId;
private String title;
private String content;
private Integer vote;
//Constructors, setters, getters, equals and hashcode
}
在我的MYSQL数据库中,内容是类型Text。我希望有像这样java.sql.Text,因为java.sql.Blob是一个实际类型,但可悲的是,不存在