As my problem was only with hierarchy childs (and only in the database layer), I've changed one line in HibernateEntity.vsl (into hibernate cartridge)

line 75 changed from:
#if($attribute.required)
     *     not-null="true"
#end

to
#if($attribute.required && !$entity.generalization)
     *     not-null="true"
#end

It runs fine for me. :-)

Regards
Bruno


Bruno Suárez Laffargue dijo lo siguiente el 28/09/2004 20:20:
Hi all,

I'm getting an unexpected non-null error from the database.
I have M3 version, from a week or two ago.

I have a hierarchy of clases C, C1 and C2. C1 and C2 are sons of C, they're at the same level.
I have an attribute att1 in C1 and another one att2 in C2.

When I try to make a save of C1 I get: Missing non-NULL value: att2.

In fact, in my C1 object I have no attribute att2 to set...

I know that is because of the one table per hierarchy solution.
I've thinked two ways of solving it:
    - setting the attributes of every child of the hierarchy as nullables. (this makes the scenario unreal, because the attributes are not nullable for the subclasses)
    - setting the attribute a default value in the model. (I haven't see any change, neither in the java class, neither in the create table sentence)

Is there any other way to solve it?

Thanks
Bruno





------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Andromda-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/andromda-user
------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Andromda-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/andromda-user

Reply via email to