I'm refining down the trouble I mentioned in another thread.
The first mapping below works fine. The second mapping fails. Note the only different is that "ValueObject" has a simple map added to it. Can anyone explain why this fails?
Quote:
Schema text failed: Problem trying to set property
type by reflection: Could not find a getter for stuff in class ValueObject
This mapping works fine:
Code:
<class name="KeyObject" table="ko">
<id name="id" type="string" unsaved-value="null" >
<column name="id" sql-type="char(32)" not-null="true"/>
<generator class="uuid.hex"/>
</id>
<property name="name" type="string" not-null="true"/>
<property name="someField" type="string" not-null="true"/>
</class>
<class name="ValueObject" table="vo">
<id name="id" type="string" unsaved-value="null" >
<column name="id" sql-type="char(32)" not-null="true"/>
<generator class="uuid.hex"/>
</id>
<property name="name" type="string" not-null="true"/>
<property name="someOtherField" type="string" not-null="true"/>
</class>
<class name="MapClass" table="mc">
<id name="id" type="string" unsaved-value="null" >
<column name="id" sql-type="char(32)" not-null="true"/>
<generator class="uuid.hex"/>
</id>
<map name="kvMapping" lazy="true" >
<key column="id"/>
<composite-index class="KeyObject" >
<key-property name="name"/>
<key-property name="someField"/>
</composite-index>
<composite-element class="ValueObject" />
</map>
<property name="name" type="string" not-null="true"/>
<property name="someOtherField" type="string" not-null="true"/>
</class>
2nd mapping, fails:
Code:
<class name="KeyObject" table="ko">
<id name="id" type="string" unsaved-value="null" >
<column name="id" sql-type="char(32)" not-null="true"/>
<generator class="uuid.hex"/>
</id>
<property name="name" type="string" not-null="true"/>
<property name="someField" type="string" not-null="true"/>
</class>
<class name="ValueObject" table="vo">
<id name="id" type="string" unsaved-value="null" >
<column name="id" sql-type="char(32)" not-null="true"/>
<generator class="uuid.hex"/>
</id>
<property name="name" type="string" not-null="true"/>
<property name="someOtherField" type="string" not-null="true"/>
<map name="stuff" lazy="true" >
<key column="id"/>
<index column="key" type="string"/>
<element column="value" type="string"/>
</map>
</class>
<class name="MapClass" table="mc">
<id name="id" type="string" unsaved-value="null" >
<column name="id" sql-type="char(32)" not-null="true"/>
<generator class="uuid.hex"/>
</id>
<map name="kvMapping" lazy="true" >
<key column="id"/>
<composite-index class="KeyObject" >
<key-property name="name"/>
<key-property name="someField"/>
</composite-index>
<composite-element class="ValueObject" />
</map>
<property name="name" type="string" not-null="true"/>
<property name="someOtherField" type="string" not-null="true"/>
</class>
Quote: