A Component is a containted object that is be persisted value type and not an entity.But you can embed the component to entity. Now We need one-to-one association for husband an wife. We just let the in one table. Then we create one entity, on compon…
Hibernate understands both the Java and JDBC representations of application data. The ability to read and write object data to a database is called marshalling, and is the function of a Hibernate type. A type is an implementation of the org.hibernate…
Hibernate的所有session都是由sessionFactory来生成的,那么,sessionFactory是怎么得来的呢?它与我们配置的xxx.cfg.xml文件以及xxx.hbm.xml文件之间又有着怎么样的联系呢? 先看一小段生成sessionFactory的代码: code_1: public class HibernateTest { @Test public void test() { System.out.println("test..."); //1. 创建一个…