I have a slight problem that when I SQL generate particular tables in EOModeler, with 'Create Tables' and 'Primary Key Constraints' set, I get a null index created, which SQL complains:

Error from JDBC adaptor: EvaluateExpression failed: <OpenBasePlugIn $OpenBaseExpression: "create index null PRIMARY_KEY">: Next exception:SQL State:42000 -- error code: 0 -- msg: SQL ERROR - [position 12, near ' ' in 'eate index null PRIMARY_K'] Index Table Error: table name expected but not found.
SQL: [EMAIL PROTECTED]

The generated SQL is:


CREATE TABLE IMAGES (OWNER_KEY longlong NOT NULL, PRIMARY_KEY longlong NOT NULL, TYPE char(1) , URL char(128) );

ALTER TABLE IMAGES ADD PRIMARY KEY (PRIMARY_KEY);

create unique index IMAGES PRIMARY_KEY;

create index null PRIMARY_KEY;

delete from _SYS_RELATIONSHIP where relationshipName = 'owner' and source_table = 'IMAGES' ;

insert into _SYS_RELATIONSHIP (relationshipName, source_table, source_column, dest_table, dest_column, operator, one_to_many) values ('owner','IMAGES','OWNER_KEY','null','PRIMARY_KEY','=',0);



The cause of this problem is that the table IMAGES has a relationship to anything you can have images of, all of which inherit from an abstract, tableless entity name 'Artiffact'. Hence, relationship 'owner' is defined as:

owner: owner_key -> Artifact.primary_key

but since Artifact's table name in the inspector is null, I get the null in 'create index null PRIMARY_KEY;'. All subclasses of Artifact of course have unique primary keys wrt Artifact. This does not seem to have any adverse impact on the operation of the DB. Should I be worried, or define the model in a better way? Should this be reported as a bug to Apple?

Thanks
Ian Joyner
Sportstec
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to