Description
Christian Ista created an issue — 18th September 2011, 9:24:03:
Hello,
I have a classic
Order
andOrderLine
tables. When I get an order when I try to load theOrderLines
I receive an exception. The code look correct and the NHProf log show me an error in the query.I join the NHProf log.
The mapping is for Order object :
<set name="OrderLines" table="OrderOrderLine" inverse="true" cascade="all-delete-orphan" > <key column="Order" /> <one-to-many class="OrderLine" /> </set>and
OrderLine object :
<many-to-one name="Order" column="Order" not-null="true" />
Christian Ista added a comment — 18th September 2011, 11:46:43:
I replaced in project Order by Purchase and OrderLine by PurchaseLine and no more problem, there is a bug somewhere. HTH
sbohlen added a comment — 18th September 2011, 12:48:30:
"Order" is a reserved word in most relational databases. Are you certain that you are properly escaping reserved words? Since your mapping snippet doesn't show you explicitly escaping reserved words (e.g., you have
<key column="Order" />
rather than<key column="
Order" />
), can you ensure that you are properly using the<property name="hbm2ddl.keywords">auto-quote</property>
value in yourhibernate.cfg
file?
Christian Ista added a comment — 18th September 2011, 13:13:49:
Yes I use
<property name="hbm2ddl.keywords">auto-quote</property>
in the config file. In the past (with other version of NH) I usedOrder
andOrderLines
without any problem.