• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
SQL generation 'create index null'?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SQL generation 'create index null'?


  • Subject: SQL generation 'create index null'?
  • From: Ian Joyner <email@hidden>
  • Date: Wed, 14 Dec 2005 11:59:14 +1100

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: [B@edb8c6


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@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: SQL generation 'create index null'?
      • From: Chuck Hill <email@hidden>
  • Prev by Date: Re: Fun with Primitives
  • Next by Date: Re: SQL generation 'create index null'?
  • Previous by thread: Re: stringQualifierOperators (like, contains)
  • Next by thread: Re: SQL generation 'create index null'?
  • Index(es):
    • Date
    • Thread