Is it necessary to have an attribute that corresponds to the foreign-key to its parent object, defined in a bean?
To illustrate, I have a class:
Code:
class Window
{
private List holes; // List of Holes
// accessor and mutators
}
and another:
Code:
class Hole
{
private boolean isBufferOverflow;
// accessor and mutators
}
In order to persist this, should I be able to simply create:
Code:
<hibernate-mapping package="">
<class name="Window" table="WINDOW">
<set name="holes" cascade="all" inverse="false" lazy="false">
<one-to-many class="Hole"/>
</set>
</class>
<class name="Hole" table="HOLE">
<property name="isBufferOverflow" column="BUFFER_OVERFLOW" />
</class>