Hi,
I have a table core_locale, which has two foreign keys. Following is the class
descriptor. I also created a corresponding value object LocaleBean, which includes
field properties: countryCode and languageCode as well as reference properties:
countryCodeCountry and languageCodeLanguage. All getter/setter methods are also
created. However, I found that when I try to save an instance of LocaleBean, if I only
set values for countryCode and languageCode (without setting values for
countryCodeCountry and languageCodeLanguage), it will try to insert NULL into
COUNTRY_CODE and LANGUAGE_CODE columns. But it will work if I set valules for
countryCodeCountry and languageCodeLanguage, while leave countryCode and languageCode
as null. Looks like the values for countryCodeCountry and languageCodeLanguage will
always overwrite the values for countryCode and languageCode. I am just wondering
whether this is purposely designed in this way and if so, what's the reason. When
auto-update is set to false (which is default), I think it makes more sense for user
to just set the values for foreighn keys instead of the whole reference objects.
Thanks,
Zhe
<!--
==============================================================
TABLE CORE_LOCALE
==============================================================
-->
<class-descriptor
class="com.gsnx.prototype.core.server.util.lang.LocaleBean"
table="CORE_LOCALE"
>
<!--
COLUMN LOCALE_CODE
..............................................
-->
<field-descriptor id="1"
name="localeCode"
column="LOCALE_CODE"
jdbc-type="VARCHAR"
nullable="false"
primarykey="true"
/>
<!--
COLUMN LANGUAGE_CODE
..............................................
-->
<field-descriptor id="3"
name="languageCode"
column="LANGUAGE_CODE"
jdbc-type="VARCHAR"
nullable="false"
/>
<!--
COLUMN COUNTRY_CODE
..............................................
-->
<field-descriptor id="4"
name="countryCode"
column="COUNTRY_CODE"
jdbc-type="VARCHAR"
nullable="false"
/>
<reference-descriptor name="countryCodeCountry"
class-ref="com.gsnx.prototype.core.server.util.country.CountryBean">
<foreignkey field-ref="countryCode"/>
</reference-descriptor>
<reference-descriptor name="languageCodeLanguage"
class-ref="com.gsnx.prototype.core.server.util.lang.LanguageBean">
<foreignkey field-ref="languageCode"/>
</reference-descriptor>
</class-descriptor>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]