SHARE
TWEET

Untitled

a guest Oct 13th, 2017 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?xml version="1.0" encoding="UTF-8"?>
  2.  
  3. <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate//Hibernate Mapping DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
  4. <hibernate-mapping auto-import="true">
  5.     <class name="cz.bsc.springbookauthor.domain.Author" table="AUTHOR">
  6.         <comment>Author object - represents a single author of books.</comment>
  7.  
  8.         <id name="id" type="long">
  9.             <column name="ID" />
  10.             <generator class="native">
  11.                 <param name="sequence">author_id_seq</param>
  12.             </generator>
  13.         </id>
  14.  
  15.         <property access="property" name="name" type="string">
  16.             <column name="NAME" not-null="true" unique="false">
  17.                 <comment>The author''s artist name</comment>
  18.             </column>
  19.         </property>
  20.  
  21.         <set name="books" table="BOOK" inverse="true" lazy="true" fetch="join">
  22.             <key>
  23.                 <column name="ID" not-null="false" />
  24.             </key>
  25.             <one-to-many class="cz.bsc.springbookauthor.domain.Book" />
  26.         </set>
  27.  
  28.     </class>
  29. </hibernate-mapping>
  30.    
  31. <?xml version="1.0" encoding="UTF-8"?>
  32.  
  33. <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate//Hibernate Mapping DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
  34. <hibernate-mapping auto-import="true">
  35.     <class name="cz.bsc.springbookauthor.domain.Book" table="BOOK">
  36.         <comment>Book object - represents a book that an author wrote.</comment>
  37.  
  38.         <id name="id" type="long">
  39.             <column name="ID" />
  40.             <generator class="native">
  41.                 <param name="sequence">book_id_seq</param>
  42.             </generator>
  43.         </id>
  44.  
  45.         <property access="property" name="title" type="string">
  46.             <column name="TITLE" not-null="true" unique="false">
  47.                 <comment>The book''s title</comment>
  48.             </column>
  49.         </property>
  50.  
  51.         <many-to-one name="author" class="cz.bsc.springbookauthor.domain.Author"
  52.             fetch="select">
  53.             <column name="AUTHOR" not-null="true" />
  54.         </many-to-one>
  55.  
  56.     </class>
  57. </hibernate-mapping>
RAW Paste Data
Top