Indices

From: Borut Bolčin (cayenn..mail.si)
Date: Thu Jan 06 2005 - 04:17:17 EST

  • Next message: Jrgen Saar: "PK generation with rich clients ..."

    Hi list,

    I am starting to learn Cayenne. I have some background with WO EOF so
    some things looks familiar.

    I am trying to reverse-engineer a ver very simple database (actualy it
    contains only one table). I succeded, but wondering how to create
    indices on some of the attributes.

    The original SQL to create the table looks like this (MySql):

    CREATE TABLE NEWS (
      RECNO INT NOT NULL DEFAULT -1,
      CHANNEL_TITLE VARCHAR(100) NOT NULL,
      CHANNEL_LOCATION VARCHAR(255) NOT NULL,
      TITLE BLOB NOT NULL,
      DESCRIPTION BLOB NOT NULL,
      LINK VARCHAR(255) NOT NULL,
      IMAGE VARCHAR(255),
      PUB_DATE DATETIME NOT NULL,
      STILL_AVAILABLE_AT DATETIME NOT NULL,
      CATEGORY VARCHAR(30),
      PRIMARY KEY (RECNO),
      UNIQUE INDEX (LINK),
      INDEX CHANNEL_LOCATION_STILL_AVAILABLE_AT (CHANNEL_LOCATION,
    STILL_AVAILABLE_AT),
      INDEX CATEGORY_PUB_DATE (CATEGORY, PUB_DATE)
    )

    How do I create the last three "rows" in the above example in Cayenne
    and what would be the best approach to create such db table at my
    application startup period?

    Another question is more philosophical. I did not use stored procedures
    yet. What are the pros and cons of using them and how Cayenne fits in
    this story? Can I use the same stored procedures on Oracle and say MySQL
    v5 with Cayenne help?

    I hope I did not shoot my leg with this question. :-D

    Regards,
    Borut



    This archive was generated by hypermail 2.0.0 : Thu Jan 06 2005 - 04:17:28 EST