User Tools

Site Tools


jpa:hibernate

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
jpa:hibernate [2019/01/27 20:06] odeftajpa:hibernate [2019/01/27 20:11] odefta
Line 14: Line 14:
  
  
-For pure Hibernate API, we should use **hibernate.cfg.xml**.+For pure Hibernate API, we should use **hibernate.cfg.xml**.\\
 For JPA (Java Persistence API), the **persistence.xml** file should be used. For JPA (Java Persistence API), the **persistence.xml** file should be used.
  
 === Migrating from Hibernate API to JPA === === Migrating from Hibernate API to JPA ===
  
-If we have a pure Hibernate API project, we can use the existing configuration file in a new JPA project.+If we have a pure Hibernate API project, we can use the existing configuration file in a new JPA project.\\
 Add in persistence.xml the property **hibernate.ejb.cfgfile** Add in persistence.xml the property **hibernate.ejb.cfgfile**
  
 <code> <code>
-<persistence xmlns="http://java.sun.com/xml/ns/persistence" +<persistence  
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +   xmlns="http://java.sun.com/xml/ns/persistence"  
-    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence +   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
-http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" +   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence  
-    version="1.0">+   http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" 
 +   version="1.0" 
 +>
     <persistence-unit name="employee">     <persistence-unit name="employee">
         <properties>         <properties>
jpa/hibernate.txt · Last modified: 2023/07/04 19:36 by 127.0.0.1