Advertisement
Guest User

error

a guest
Feb 26th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. Hibernate config
  2. <?xml version="1.0" encoding="UTF-8"?>
  3. <!DOCTYPE hibernate-configuration SYSTEM
  4. "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
  5.  
  6. <hibernate-configuration>
  7. <session-factory>
  8. <property name="hibernate.dialect">
  9. org.hibernate.dialect.H2Dialect
  10. </property>
  11. <property name="hibernate.connection.driver_class">
  12. org.h2.Driver
  13. </property>
  14.  
  15. <!-- Assume test is the database name -->
  16. <property name="hibernate.connection.url">
  17. jdbc:h2:tcp://localhost/~/Nueva
  18. </property>
  19. <property name="hibernate.connection.username">
  20. sa
  21. </property>
  22. <property name="hibernate.connection.password"></property>
  23.  
  24. <!-- List of XML mapping files -->
  25.  
  26. <mapping resource="negocio/Curso.hbm.xml"/>
  27. <mapping resource="negocio/Profesor.hbm.xml"/>
  28. <mapping resource="negocio/Empleado.hbm.xml"/>
  29. </session-factory>
  30. </hibernate-configuration>
  31.  
  32.  
  33.  
  34. Curso.hbm.xml
  35. <hibernate-mapping>
  36. <class name="negocio.Curso" table="CURSO">
  37. <meta attribute="class-description">
  38. This class contains the employee detail.
  39. </meta>
  40. <id name="idCurso" type="int" column="id_curso">
  41. <generator class="native"/>
  42. </id>
  43. <property name="descripcion" column="descripcion" type="string"/>
  44.  
  45. <many-to-one name="profesor" column="id_profesor"
  46. class="negocio.Profesor" not-null="true"/>
  47. </class>
  48. </hibernate-mapping>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement