1.异常:org.hibernate.AnnotationException: No identifier specified for entity异常。
entity类是必须要主键的,否则就会报出这个异常。
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name = "id", nullable = false)
private Integer id;
2.异常:exception just for purpose of providing stack trace
count(*) 返回的结果为Long类型,而非Integer
3.异常 org.hibernate.UnknownEntityTypeException
在使用spring的orm时,entity类没在hibernate sessionFactory的扫描中,导致。@entity要使用javax的entity而不是hibernate的。