1.组建映射

可以存在一个表里面

Husband.java

package com.bjsxt.hibernate;

import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.OneToOne; @Entity
public class Husband {
private int id;
private String name;
private Wife wife;
@Id
@GeneratedValue
public int getId() {
return id;
} public String getName() {
return name;
}
@Embedded
public Wife getWife() {
return wife;
}
public void setId(int id) {
this.id = id;
}
public void setName(String name) {
this.name = name;
}
public void setWife(Wife wife) {
this.wife = wife;
} }

Wife.java

package com.bjsxt.hibernate;

public class Wife {

    private String wifeName;
private int age; public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
} public String getWifeName() {
return wifeName;
}
public void setWifeName(String name) {
this.wifeName = name;
} }

HibernateORMappingTest.java

package com.bjsxt.hibernate;

import java.util.Date;

import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.tool.hbm2ddl.SchemaExport;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test; public class HibernateORMappingTest {
private static SessionFactory sessionFactory; //@BeforeClass
public static void beforeClass() {
sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory();
}
//@AfterClass
public static void afterClass() {
sessionFactory.close();
} @Test
public void testSchemaExport() {
new SchemaExport(new AnnotationConfiguration().configure()).create(false, true);
} public static void main(String[] args) {
beforeClass();
}
}

也可以使用XML

Husband.hbm.xml

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping>
<class name="com.bjsxt.hibernate.Husband" >
<id name="id">
<generator class="native"></generator>
</id> <property name="name"></property>
<component name="wife">
<property name="wifeName"></property>
<property name="age"></property>
</component>
</class> </hibernate-mapping>

如果两个对象有属性一致 可以更改属性名 或者使用注解更改 映射的字段名

多对多和一对多

在多的一方加外键

1.annotation

Group.java

package com.bjsxt.hibernate;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table; @Entity
@Table(name="t_group")
public class Group {
private int id;
private String name;
@Id
@GeneratedValue
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

User.java

package com.bjsxt.hibernate;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table; @Entity
@Table(name="t_user")
public class User {
private int id;
private String name;
private Group group;
@ManyToOne public Group getGroup() {
return group;
}
public void setGroup(Group group) {
this.group = group;
}
@Id
@GeneratedValue
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

hibernate.cfg.xml

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost/hibernate</property>
<property name="connection.username">root</property>
<property name="connection.password">bjsxt</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<!--
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="connection.url">jdbc:oracle:thin:@localhost::SXT</property>
<property name="connection.username">scott</property>
<property name="connection.password">tiger</property>
<property name="dialect">org.hibernate.dialect.OracleDialect</property>
--> <!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size"></property> <!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">thread</property> <!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property> <!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>
<property name="format_sql">true</property> <!-- Drop and re-create the database schema on startup
<property name="hbm2ddl.auto">update</property>
--> <mapping class="com.bjsxt.hibernate.Group"/>
<mapping class="com.bjsxt.hibernate.User"/>
 <!--  
<mapping resource="com/bjsxt/hibernate/Group.hbm.xml"/> 
<mapping resource="com/bjsxt/hibernate/User.hbm.xml"/>
 -->
</session-factory> </hibernate-configuration>

test.java

package com.bjsxt.hibernate;

import java.util.Date;

import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.tool.hbm2ddl.SchemaExport;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test; public class HibernateORMappingTest {
private static SessionFactory sessionFactory; //@BeforeClass
public static void beforeClass() {
sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory();
}
//@AfterClass
public static void afterClass() {
sessionFactory.close();
} @Test
public void testSchemaExport() {
new SchemaExport(new AnnotationConfiguration().configure()).create(false, true);
} public static void main(String[] args) {
beforeClass();
}
}

2.xml

Group.hbm.xml

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping>
<class name="com.bjsxt.hibernate.Group" table="t_group">
<id name="id">
<generator class="native"></generator>
</id> <property name="name"></property> </class> </hibernate-mapping>

User.hbm.xml

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping>
<class name="com.bjsxt.hibernate.User" table="t_user">
<id name="id">
<generator class="native"></generator>
</id> <property name="name"></property>
<many-to-one name="group" column="groupId" />
</class> </hibernate-mapping>

hibernate.cfg.xml

    <?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost/hibernate</property>
<property name="connection.username">root</property>
<property name="connection.password">bjsxt</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<!--
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="connection.url">jdbc:oracle:thin:@localhost::SXT</property>
<property name="connection.username">scott</property>
<property name="connection.password">tiger</property>
<property name="dialect">org.hibernate.dialect.OracleDialect</property>
--> <!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size"></property> <!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">thread</property> <!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property> <!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>
<property name="format_sql">true</property> <!-- Drop and re-create the database schema on startup
<property name="hbm2ddl.auto">update</property>
-->
<!--
<mapping class="com.bjsxt.hibernate.Group"/>
<mapping class="com.bjsxt.hibernate.User"/> -->
<mapping resource="com/bjsxt/hibernate/Group.hbm.xml"/>
<mapping resource="com/bjsxt/hibernate/User.hbm.xml"/> </session-factory> </hibernate-configuration>

test.java一致

一对多的单向关联

在多的方向加外键

Group.java

package com.bjsxt.hibernate;

import java.util.HashSet;
import java.util.Set; import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table; @Entity
@Table(name="t_group")
public class Group {
private int id;
private String name;
private Set<User> users = new HashSet<User>();
@Id
@GeneratedValue
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@OneToMany
@JoinColumn(name="groupId")
public Set<User> getUsers() {
return users;
}
public void setUsers(Set<User> users) {
this.users = users;
}
}

如果不加@JoinColumv 变会生成多对多的关系

User.java

package com.bjsxt.hibernate;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table; @Entity
@Table(name="t_user")
public class User {
private int id;
private String name; @Id
@GeneratedValue
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

测试

package com.bjsxt.hibernate;

import java.util.Date;

import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.tool.hbm2ddl.SchemaExport;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test; public class HibernateORMappingTest {
private static SessionFactory sessionFactory; //@BeforeClass
public static void beforeClass() {
sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory();
}
//@AfterClass
public static void afterClass() {
sessionFactory.close();
} @Test
public void testSchemaExport() {
new SchemaExport(new AnnotationConfiguration().configure()).create(false, true);
} public static void main(String[] args) {
beforeClass();
}
}

2  xml

Group.hbm.xml

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping>
<class name="com.bjsxt.hibernate.Group" table="t_group">
<id name="id">
<generator class="native"></generator>
</id> <property name="name"></property>
<set name="users">
<key column="groupId"></key>
<one-to-many class="com.bjsxt.hibernate.User"/>
</set>
</class> </hibernate-mapping>

User.hbm.xml

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping>
<class name="com.bjsxt.hibernate.User" table="t_user">
<id name="id">
<generator class="native"></generator>
</id> <property name="name"></property> </class> </hibernate-mapping>

hibernate.cfg.xml

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost/hibernate</property>
<property name="connection.username">root</property>
<property name="connection.password">bjsxt</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<!--
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="connection.url">jdbc:oracle:thin:@localhost::SXT</property>
<property name="connection.username">scott</property>
<property name="connection.password">tiger</property>
<property name="dialect">org.hibernate.dialect.OracleDialect</property>
--> <!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size"></property> <!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">thread</property> <!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property> <!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>
<property name="format_sql">true</property> <!-- Drop and re-create the database schema on startup
<property name="hbm2ddl.auto">update</property>
-->
<!--
<mapping class="com.bjsxt.hibernate.Group"/>
<mapping class="com.bjsxt.hibernate.User"/> -->
<mapping resource="com/bjsxt/hibernate/Group.hbm.xml"/>
<mapping resource="com/bjsxt/hibernate/User.hbm.xml"/> </session-factory> </hibernate-configuration>

一对多双向

Group.java

package com.bjsxt.hibernate;

import java.util.HashSet;
import java.util.Set; import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table; @Entity
@Table(name="t_group")
public class Group {
private int id;
private String name;
private Set<User> users = new HashSet<User>();
@Id
@GeneratedValue
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@OneToMany(mappedBy="group") public Set<User> getUsers() {
return users;
}
public void setUsers(Set<User> users) {
this.users = users;
}
}

User.java

package com.bjsxt.hibernate;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table; @Entity
@Table(name="t_user")
public class User {
private int id;
private String name;
private Group group;
@ManyToOne
public Group getGroup() {
return group;
}
public void setGroup(Group group) {
this.group = group;
}
@Id
@GeneratedValue
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

hibernate.cfg.xml

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost/hibernate</property>
<property name="connection.username">root</property>
<property name="connection.password">bjsxt</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<!--
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="connection.url">jdbc:oracle:thin:@localhost::SXT</property>
<property name="connection.username">scott</property>
<property name="connection.password">tiger</property>
<property name="dialect">org.hibernate.dialect.OracleDialect</property>
--> <!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size"></property> <!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">thread</property> <!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property> <!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>
<property name="format_sql">true</property> <!-- Drop and re-create the database schema on startup
<property name="hbm2ddl.auto">update</property>
--> <mapping class="com.bjsxt.hibernate.Group"/>
<mapping class="com.bjsxt.hibernate.User"/> <!--
<mapping resource="com/bjsxt/hibernate/Group.hbm.xml"/>
<mapping resource="com/bjsxt/hibernate/User.hbm.xml"/>
-->
</session-factory> </hibernate-configuration>

HibernateORMappingTest.java

package com.bjsxt.hibernate;

import java.util.Date;

import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.tool.hbm2ddl.SchemaExport;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test; public class HibernateORMappingTest {
private static SessionFactory sessionFactory; //@BeforeClass
public static void beforeClass() {
sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory();
}
//@AfterClass
public static void afterClass() {
sessionFactory.close();
} @Test
public void testSchemaExport() {
new SchemaExport(new AnnotationConfiguration().configure()).create(false, true);
} public static void main(String[] args) {
beforeClass();
}
}

2.xml方式

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping>
<class name="com.bjsxt.hibernate.Group" table="t_group">
<id name="id">
<generator class="native"></generator>
</id> <property name="name"></property>
<set name="users">
<key column="groupId"></key>
<one-to-many class="com.bjsxt.hibernate.User"/>
</set>
</class> </hibernate-mapping>

User.hbm.xml

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping>
<class name="com.bjsxt.hibernate.User" table="t_user">
<id name="id">
<generator class="native"></generator>
</id> <property name="name"></property>
<many-to-one name="group" column="groupId"></many-to-one>
</class> </hibernate-mapping>

hibernate.cfg.XML

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost/hibernate</property>
<property name="connection.username">root</property>
<property name="connection.password">bjsxt</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<!--
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="connection.url">jdbc:oracle:thin:@localhost::SXT</property>
<property name="connection.username">scott</property>
<property name="connection.password">tiger</property>
<property name="dialect">org.hibernate.dialect.OracleDialect</property>
--> <!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size"></property> <!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">thread</property> <!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property> <!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>
<property name="format_sql">true</property> <!-- Drop and re-create the database schema on startup
<property name="hbm2ddl.auto">update</property>
-->
<!--
<mapping class="com.bjsxt.hibernate.Group"/>
<mapping class="com.bjsxt.hibernate.User"/>
--> <mapping resource="com/bjsxt/hibernate/Group.hbm.xml"/>
<mapping resource="com/bjsxt/hibernate/User.hbm.xml"/> </session-factory> </hibernate-configuration>

TEST一致

Hibernate学习笔记3.2(Hibernate组建映射)的更多相关文章

  1. Hibernate学习笔记二:Hibernate缓存策略详解

    一:为什么使用Hibernate缓存: Hibernate是一个持久层框架,经常访问物理数据库. 为了降低应用程序访问物理数据库的频次,从而提高应用程序的性能. 缓存内的数据是对物理数据源的复制,应用 ...

  2. Hibernate学习笔记三:对象关系映射(一对一,一对多,多对一,多对多)

    如需转载,请说明出处:http://www.cnblogs.com/gudu1/p/6895610.html Hibernate通过关系映射来表示数据库中表与表之间的关系,关系映射可以通过两种方式:配 ...

  3. HIbernate学习笔记(六) 关系映射之多对多

    六.多对多 - 单向 Ø        一般的设计中,多对多关联映射,需要一个中间表 Ø        Hibernate会自动生成中间表 Ø        Hibernate使用many-to-ma ...

  4. HIbernate学习笔记(五) 关系映射之一对多与多对一

    三.       多对一 –单向 场景:用户和组:从用户角度来,多个用户属于一个组(多对一 关联) 使用hibernate开发的思路:先建立对象模型(领域模型),把实体抽取出来. 目前两个实体:用户和 ...

  5. Hibernate学习笔记(四)关系映射之一对一关联映射

    一. 一对一关联映射 ²        两个对象之间是一对一的关系,如Person-IdCard(人—身份证号) ²        有两种策略可以实现一对一的关联映射 Ø        主键关联:即让 ...

  6. Hibernate学习笔记(五) — 多对多关系映射

    多对多关系映射 多对多建立关系相当于在第三张表中插入一行数据 多对多解除关系相当于在第三张表中删除一行数据 多对多改动关系相当于在第三张表中先删除后添加 多对多谁维护效率都一样.看需求 在实际开发过程 ...

  7. Hibernate学习笔记--第一个Hibernate框架程序

    一般使用集成开发环境是,把所需的类库添加到项目属性的库路径中,开发工具在部署时会自动复制所需要的类包到WEB-INF\lib目录下 MyEclipse中: 创建项目,右击项目->myeclips ...

  8. Hibernate学习笔记(二)

    2016/4/22 23:19:44 Hibernate学习笔记(二) 1.1 Hibernate的持久化类状态 1.1.1 Hibernate的持久化类状态 持久化:就是一个实体类与数据库表建立了映 ...

  9. Hibernate学习笔记(一)

    2016/4/18 19:58:58 Hibernate学习笔记(一) 1.Hibernate框架的概述: 就是一个持久层的ORM框架. ORM:对象关系映射.将Java中实体对象与关系型数据库中表建 ...

  10. Hibernate 学习笔记一

    Hibernate 学习笔记一 今天学习了hibernate的一点入门知识,主要是配置domain对象和表的关系映射,hibernate的一些常用的配置,以及对应的一个向数据库插入数据的小例子.期间碰 ...

随机推荐

  1. mybaits插入时的一些总结

    我们时长在批量插入时,需要获取插入数据的id. 这样: <insert id="insertUser" parameterType="gys.entity.User ...

  2. Windows 2016 无域故障转移群集部署方法 超详细图文教程 (一)

    故障转移群集是一个很实用的功能,而windows在2016版本开始,终于支持不用域做故障转移群集. 在群集中,我们可以设定一个"群集IP" 而客户端只需要根据这个"群集I ...

  3. js样式之渐变线

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  4. 【Selenium-WebDriver自学】Selenium-RC脚本编写(十)

    ==================================================================================================== ...

  5. Ansible:遇到错误 "sudo: /etc/sudoers is world writable\r\nsudo: no valid sudoers sources found, quitting

    执行ansible-playbook时,遇到该错误: 经过检查发现是因为在Linux中 /etc/sudoers该文件必须是只读权限的才行,故我们需要修改其权限为440,到root账户下修改,直接ch ...

  6. Strandbeest mechanism and Leg mechanism

    I have to say besides computer science study, I'm also interested in Leg mechanism. Share two keywor ...

  7. Faster RCNN原理分析(二):Region Proposal Networks详解

    Faster RCNN原理分析(二):Region Proposal Networks详解 http://lib.csdn.net/article/deeplearning/61641 0814: A ...

  8. Windows2008R2安装Exchange 2010前必须要做的准备工作

    由于WindowsServer2008R2已经包含了KB979099.KB982867.KB979744.KB983440.KB977020这些补丁的内容,所以无须另外下载安装. 详见https:// ...

  9. 开源 人脸识别 openface 实用介绍 实例演示 训练自己的模型

    1.OpenFace 是 卡耐基梅陇(CMU)大学的一个图像+机器学习项目,整体程序包含:人脸发现,特征提取,特征神经网络训练,人脸识别这四部分. github   https://github.co ...

  10. scrapy之如何迭代spider 的parse函数生成器

    Engine.py (core):        d = self.scraper.enqueue_scrape(response, request, spider) def _handle_down ...