Re: eo abstract classes and sequences
Re: eo abstract classes and sequences
- Subject: Re: eo abstract classes and sequences
- From: Chuck Hill <email@hidden>
- Date: Fri, 22 Mar 2013 15:38:09 -0700
On 2013-03-22, at 10:24 AM, Jürgen Tabert wrote:
> Hi Chuck,
>
> thanks for the quick explanation. But this leads to the question why the Entity Modeler generates the useless sequences for the subclasses
> and omits the sequence for the abstract class.
That is not Entity Modeler, that is from EOF or the database plugin.
> If no table name is defined on the abstract class the runtime uses the class name to create the
> needed sequence.
>
> In my case the Entity Modeler can't generate a table for the abstract class because I didn't define a table name. There will never be an entity of this class.
For FrontBase, I generate the table anyway as the sequence generation requires it. It sounds as if that is the easiest solution for you too. Otherwise you will need to create a sequence with that classname, or alter the plug-in to generate the sequence.
Chuck
> On 22.03.2013, at 17:36, Chuck Hill <email@hidden> wrote:
>
>> Hi Jürgen,
>>
>> You are not doing anything wrong, that is how it is supposed to work. The GlobalID for all objects in the hierarchy is generated from the top most (abstract in your case) Entity name and the primary key. That implies that the primary key need to be unique across all of the tables in the hierarchy, not just in each table. To ensure this, EOF only generated PKs from the sequence in the top most entity/table.
>>
>> I am not sure why it is not generating a table for that entity, I don't use Postgres much. Did you define the table name and the column names etc in the model?
>>
>>
>> Chuck
>>
>>
>>
>> On 2013-03-22, at 9:30 AM, Jürgen Tabert wrote:
>>
>>> Hi all,
>>>
>>> in my eomodel I have one abstract class (without a table) and three subclasses. The Entity Modeler generates the sql code for
>>> the three tables, sequences … and nothing for the abstract class. At runtime the system tries to create/use the sequence for the
>>> abstract class. I don't understand why.
>>> Two questions:
>>> What am I doing wrong?
>>> Is it possible to prevent this behaviour?
>>> by the way PostgreSQL database
>>>
>>> Thanks
>>> Jürgen
>>>
>>> _______________________________________________
>>> Do not post admin requests to the list. They will be ignored.
>>> Webobjects-dev mailing list (email@hidden)
>>> Help/Unsubscribe/Update your Subscription:
>>>
>>> This email sent to email@hidden
>>
>> --
>> Chuck Hill
>> Executive Managing Partner, VP Development and Technical Services
>>
>> Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
>> http://www.global-village.net/gvc/practical_webobjects
>>
>> Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest Growing Companies in B.C!
>> Global Village Consulting ranks 76th in 24th annual PROFIT 200 ranking of Canada’s Fastest-Growing Companies by PROFIT Magazine!
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>
>
--
Chuck Hill
Executive Managing Partner, VP Development and Technical Services
Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/gvc/practical_webobjects
Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest Growing Companies in B.C!
Global Village Consulting ranks 76th in 24th annual PROFIT 200 ranking of Canada’s Fastest-Growing Companies by PROFIT Magazine!
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden