Re: Key generator question

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Tue Mar 04 2003 - 15:20:34 EST

  • Next message: Andriy Shapochka: "Fw: Key generator question"

    One of our committers, Andriy, implemented that feature recently. It may
    not be fully integrated yet and is probably not supported by the modeler.
    Andriy, can you comment on that?

    Andrus

    P.S. Andriy, you might want to subscribe to to cayenne-user, your recent
    additions are in really high demand ;-)

    > Hi,
    >
    > Does anyone know if it's possible to use a custom oracle sequence to
    > generate PKs? The following lines were extracted from data-map.dtd:
    >
    > <db-key-generator>
    > <db-generator-type>ORACLE</db-generator-type>
    > <db-generator-name>test_sequence</db-generator-name>
    > <db-key-cache-size>10</db-key-cache-size>
    > </db-key-generator>
    >
    > however noone seems to use it -- a grep for "key-generator" returns
    > nothing and code for OraclePkGenerator.sequencyName():
    >
    > protected String sequenceName(DbEntity ent) {
    > String entName = ent.getName();
    > String seqName = _SEQUENCE_PREFIX + entName.toLowerCase();
    >
    > if (ent.getSchema() != null && ent.getSchema().length() > 0) {
    > seqName = ent.getSchema() + "." + seqName;
    > }
    >
    > return seqName;
    > }
    >
    >
    > I have to work with a legacy database, and can't change anything :-( so
    > changing the sequence name to mach PK_attribname is not an option for
    > me. Also, can I use sequence generator with composite keys, i.e. ID and
    > name as PK?
    >
    >
    > Thanks for your help,
    >
    > --
    > Fabricio Voznika
    > Senior Programmer/Analyst
    > Administrative Computing
    > Dartmouth College
    > Phone: 603-646-2007



    This archive was generated by hypermail 2.0.0 : Tue Mar 04 2003 - 15:20:35 EST