Advertisement
Guest User

my answer

a guest
Dec 17th, 2012
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 1.58 KB | None | 0 0
  1. Solving the problem indicated by  @JB_Nizet I faced a new error about the validation.
  2. (Note: The problem of the space was a myeclipse bug. I tried with a project and it was myeclipse which added that evil space.) I added the following line to hibernate.cfg.xml and the problem was partly solved. The new error was (%%%% Error Creating SessionFactory %%%%
  3. org.hibernate.HibernateException: Error applying BeanValidation relational constraints)
  4.  
  5.     <property name="javax.persistence.validation.mode">none</property>
  6.  
  7. The new error was hibernate sql query error. The id should have been assigned so I changed Hitest.hbm.xml to
  8.  
  9.     <?xml version="1.0" encoding="utf-8"?>
  10.     <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
  11.    "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
  12.     <!--
  13.        Mapping file autogenerated by MyEclipse Persistence Tools
  14.    -->
  15.     <hibernate-mapping>
  16.         <class name="sor.hibernate.Hitest" table="hitest" catalog="test">
  17.             <id name="id" type="java.lang.Integer">
  18.                 <column name="id" />
  19.                 <generator class="increment" />
  20.             </id>
  21.             <property name="greeting" type="java.lang.String">
  22.                 <column name="greeting" length="200" />
  23.             </property>
  24.             <property name="date" type="java.util.Date">
  25.                 <column name="date" length="10" />
  26.             </property>
  27.             <property name="ref" type="java.lang.Integer">
  28.                 <column name="ref" />
  29.             </property>
  30.         </class>
  31.     </hibernate-mapping>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement