核心包:beans、context、core、expression 日志包:com.springsource.org.apache.commons.logging-1.1.1 老版要求的包:com.springsource.org.apache.log4j-1.2.15 配置文件 applicationContext.xml(位置和名称任意,建议用这个并放在src下) <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> <!-- 配置对象 --> <.... Spring Spring
ORM(Object/Relation Mapping): 对象/关系映射 ORM 主要解决对象-关系的映射 ORM的思想:将关系数据库中表中的记录映射成为对象,以对象的形式展现,程序员可以把对数据库的操作转化为对对象的操作。 ORM 采用元数据来描述对象-关系映射细节, 元数据通常采用 XML 格式, 并且存放在专门的对象-关系映射文件中. 配置文件 元数据(xxx.hbm.xml) <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> <!-- 配置表与实体对象的关系 --> <!-- package属性:填写一个包名.在元素内部凡是需要书写完整类名的属性,可以直接写简答类名了. --> <hibernate-mapping pac.... Hibernate Java