John Citizen [
https://community.jboss.org/people/johnqcitizen] created the discussion
"Re: Getting "association error" when reverse-engineering an existing
schema with Hibernate tools"
To view the discussion, visit:
https://community.jboss.org/message/801995#801995
--------------------------------------------------------------
Thanks for the response.
The *reveng.xml* file is shown a few posts above, but I will repeat it here:
<?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>
<schema-selection match-schema="*MY_SCHEMA*" />
</hibernate-reverse-engineering>
Note that if I modify *reveng.xml* to remove the table BAZ (see post #1 for relationships
between tables) then the reverse engineering succeeds:
<?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-schema="*MY_SCHEMA*" match-name="BAZ"
exclude="true"/>
</hibernate-reverse-engineering>
I can also create another *reveng.xml* that will only reverse engineer the table BAZ. I
thought that might solve my issue, but then I get other problems to do with mixing
nullable and non-nullable columns when the session is created (or: when the generated
classes are loaded), which I assume is a consequence of reverse-engineering one schema in
two separate stages.
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/801995#801995]
Start a new discussion in JBoss Tools at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]