1,JPA:全称是java persistence API ,
简单理解:JPA是标准接口,hibernate是实现,但是其功能是JPA的超集。
2,hibernate如何实现与JPA的关系?
通过hibernate-annotation ,hibernate- entitymanager和hibernate- core 三个组件来实现。
3,在一般实际开发中,优先考虑使用JPA注解,这样更有利于程序的移植和扩展。
4,hibernate注解的分类:
1,类级别注解:主要是@Entity @Table @Embeddable 嵌入类
2,属性级别注解3,映射关系注解
简单理解:JPA是标准接口,hibernate是实现,但是其功能是JPA的超集。
2,hibernate如何实现与JPA的关系?
通过hibernate-annotation ,hibernate- entitymanager和hibernate- core 三个组件来实现。
3,在一般实际开发中,优先考虑使用JPA注解,这样更有利于程序的移植和扩展。
4,hibernate注解的分类:
1,类级别注解:主要是@Entity @Table @Embeddable 嵌入类
2,属性级别注解3,映射关系注解
2018-03-21
4.2.4不需要创建SessionFactory 老师可能是习惯吧
// 创建hibernate配置对象
Configuration config = new Configuration().configure();
SchemaExport schema = new SchemaExport(config);
schema.create(true, true);
// 创建hibernate配置对象
Configuration config = new Configuration().configure();
SchemaExport schema = new SchemaExport(config);
schema.create(true, true);
2018-03-21
http://files.cnblogs.com/files/lt123/hib_anno3.rar
2018-02-28