I just checked in fixes for these (and a couple other things) with
the following solutions:
1) any attributes that are NOT inherited in single table inheritance
entities are set to allows null during sql creation (i.e. if you add
a new attribute in a subclass, it is set to allows null, but if there
is a shared attribute in the parent class, that DOES allow null
restriction, since they all would have it)
2) if you only select either the parent or a single child of a single
inheritance relationship, it will automatically include sql
generation for the rest of the children and parents to make sure the
table sql is as correct as it can be (in EOM, it just gives you some
weird partial table creation)
3) if you have any single table inheritance tables in your sql gen,
it creates a two-pass sql gen script -- one that does drops and one
that does creates, where the first pass uniques the table names (so
it doesn't generate duplicates). the downside here is that you get
two transactions
ms
On Jul 30, 2006, at 7:53 AM, Guido Neitzer wrote:
> On 30.07.2006, at 6:52 Uhr, Mike Schrag wrote:
>
>> SQL Generation is in ...
>
> Very nice work Mike. One question though for general handling: how
> is one supposed to open a model? Double click on an entity inside
> the eomodeld folder?
>
> Another thing:
>
> As you don't do the sql generation yourself, I don't know whether
> you can possibly solve the problems with entity inheritance like
> "the impossible constraint".
>
> Situation:
>
> Entity Person exits. Entity AppUser inherits (Single Table
> Inheritance) from it and defines two additional attributes (besides
> others): login and password. They are set to "not null". EOModeler
> and Entity Modeler generate wrongs sql for this: they set login and
> password to be not null in the database too, so you can't create
> Person instances anymore as they don't know anything about the
> attributes.
>
> But I like to have them marked as "not null" because with this I
> get validation messages from EOF about it.
>
> Also with single table inheritance the "drop table xy" appears as
> often as used in entities, which is also not correct.
>
> But, thanks for this nice piece of work! I'm very used to using
> EOModeler and I mostly like it despite its problems. I'll see how I
> can benefit from using Entity Modeler.
>
> cug
This archive was generated by hypermail 2.0.0 : Sun Jul 30 2006 - 09:22:38 EDT