Hi Fabio.

Thank you for responding so quickly.

The truth is that what you say makes sense, but then I guess that
Hibernate should take note that if all properties are null the
corresponding record in the database should not exist. The problem is
that the record is always created, even when the properties contain
null values. Therefore when you try to remove the entity an error
ocurs because there is a relationship in the database.

I'll try to do something with what you said.

Thank you very much!


On 1 jul, 20:04, Fabio Maulo <[email protected]> wrote:
> I don't think somebody should "fix" that issue (more... somebody should
> close it as "won't fix").A component with all properties null is nothing
> (mean is null it self).
> There is another possibility... a component is always created even when all
> properties are null (this is not the way NH is working).
> As usual you can override the NH default behaviour (we can't cover all
> taste) using a custom <tuplizer> for your component.
>
> 2009/7/1 ernestmartin <[email protected]>
>
>
>
>
>
>
>
> > Hello everyone.
>
> > I'm trying make an entity containing a dictionary with their texts in
> > several languages. To do this I created the product class that
> > contains this simple properties:
>
> > ----------------
> > public virtual string Name { get; set; }
> > public virtual IDictionary<Culture, CultureText> CultureTexts
> > {
> >  get { return cultureTexts; }
> >  protected set { cultureTexts = value; }
> > }
> > private IDictionary<Culture, CultureText> cultureTexts = new
> > Dictionary<Culture, CultureText>();
> > ----------------
>
> > and a CultureText class that contains this:
>
> > ----------------
> > public virtual string Description { get; set; }
> > public virtual string OtherDetails { get; set; }
> > ----------------
>
> > The mapping is as follows:
>
> >  <class name="Product">
> >    <id name="Id">
> >      <generator class="native">
> >        <param name="sequence">Product_Sequence</param>
> >      </generator>
> >    </id>
> >    <property name="Name" length="150" not-null="true" />
> >    <map name="CultureTexts" table="Product_i18n" lazy="false">
> >      <key column="ProductId" not-null="true" />
> >      <map-key-many-to-many column="CultureId" class="Culture" />
> >      <composite-element class="ProductText">
> >        <property name="Description" length="250" />
> >        <property name="OtherDetails" length="250" />
> >      </composite-element>
> >    </map>
> >  </class>
>
> > The problem is that when the texts are null (both properties)
> > collection is not loaded and errors begin to occur.
>
> > I found this bug in Hibernate:
> >http://opensource.atlassian.com/projects/hibernate/browse/HHH-3836
>
> > There seems to be the same problem with NHibernate.
>
> > Someone can help me with this problem? (some workaround)
>
> > Thanks in advance
>
> --
> Fabio Maulo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to