annotation的作法:一般用这个
在@Id下直接加@GenerratedValue(默认是auto相当于native),会自动识别是什么数据库,若是oracle则是sequence,mysql是auto_increment
xml的作法:
需要在hibernate.cfg.xml文件里进行配置,参考.../hibernate\project\etc中的hibernate.properties文件
annotation的作法:一般用这个
在@Id下直接加@GenerratedValue(默认是auto相当于native),会自动识别是什么数据库,若是oracle则是sequence,mysql是auto_increment
xml的作法:
需要在hibernate.cfg.xml文件里进行配置,参考.../hibernate\project\etc中的hibernate.properties文件