Configuring custom key generator

From: Roger Parkinson (roge..enanque.co.nz)
Date: Thu Oct 26 2006 - 16:56:05 EDT

  • Next message: Borut Bolčina: "Re: Configuring custom key generator"

    I have extended JdbcPkGenerator to generate a custom primary key and it works fine in unit testing.
    How do I tell Cayenne to use my class instead of standard  JdbcPkGenerator?

    Searching the messages reveals I should do something like:

    DbAdapter adapter = dataNode.getAdapter();
    PropertyUtils.setProperty(adapter,"pkGenerator",new MyJdbcPkGenerator());

    But I don't know where to actually put this code so that it will use my generator everywhere.
    Thanks

    --

    Roger Parkinson
    +64 21 508 792



    This archive was generated by hypermail 2.0.0 : Thu Oct 26 2006 - 16:58:02 EDT