[jboss-user] [JBoss Tools (users)] - Re: Hibernate reverse engineering errors

bdlink do-not-reply at jboss.com
Fri Mar 6 21:37:07 EST 2009


OK, I edited the reveng.xml file by hand, eliminating all of the empty string attribures, and that eliminates the exception (cheers!)

I looked at my DB to see why extra associations were showing up and found duplicate foreign key constraints that mysql added at some time, and when I removed these, I get the associations I would expect.  

So things are much improved!  There are some remaining issues I am looking at including :
1. Even though I annotate a foreign key with one-to-one, the property is marked with @ManyToOne and the inverse side uses a Set (when it is not excluded).  

2. I have one case where there are two associations between Student and Review (both one Student to many Reviews).  In the ReviewHome class it injects two studentHome components (duplicate names), where one of them should be a different @Role.  (I think this is in JIRA from long ago, but I will check later)

The one-to-one issue is obviously more important.

Updated reveng.xml:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-reverse-engineering PUBLIC "-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" >
  | 
  | <hibernate-reverse-engineering>
  | 	<table-filter match-catalog="infosys" match-name="review" />
  | 	<table-filter match-catalog="infosys" match-name="student" />
  | 	<table-filter match-catalog="infosys" match-name="team" />
  | 	<table-filter match-catalog="infosys" match-name="user_auth" />
  | 	<table-filter match-catalog="infosys" match-name="user_roles" />
  | 	<table-filter match-catalog="infosys" match-name="xuser" />
  | 	<table catalog="infosys" name="team">
  | 		<foreign-key constraint-name="team_ibfk_1">
  | 		    <one-to-one property="leader"/>
  | 			<inverse-one-to-one exclude="true" />
  | 		</foreign-key>
  | 	</table>
  | 	<table catalog="infosys" name="student">
  | 		<foreign-key constraint-name="student_ibfk_1">
  | 		    <many-to-one property="team"/>
  | 			<set property="members"/>
  | 		</foreign-key>
  | 		<foreign-key constraint-name="student_ibfk_2">
  | 		    <one-to-one property="user"/>
  | 		</foreign-key>
  | 	</table>
  | 	<table catalog="infosys" name="review">
  | 		<foreign-key constraint-name="review_ibfk_1">
  | 		    <many-to-one property="employee"/>
  | 		</foreign-key>
  | 		<foreign-key constraint-name="review_ibfk_2">
  | 		    <many-to-one property="reviewer"/>
  | 			</foreign-key>
  | 	</table>
  | 	<table catalog="infosys" name="xuser" class="ca.bcit.infosys.entity.User" >
  | 		<foreign-key constraint-name="xuser_ibfk_1">
  | 		    <one-to-one property="userAuth" exclude="true"/>
  | 		</foreign-key>
  | 	</table>
  | 	<table catalog="infosys" name="user_roles" class="ca.bcit.infosys.entity.UserRole">
  | 		<column name="userRoles" property="userRole"/>
  | 		<foreign-key constraint-name="user_roles_ibfk_1">
  | 		    <many-to-one exclude="true"/>
  | 		</foreign-key>
  | 	</table>
  | </hibernate-reverse-engineering>

I understand getting things through for GA is taking a long time, thanks for replying!


View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4215914#4215914

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4215914



More information about the jboss-user mailing list