question about key generation

From: Roman D (dostic..mail.com)
Date: Wed Feb 23 2005 - 13:39:26 EST

  • Next message: Sami Mohammed: "RE: Pagination query"

    Hi,

    I am Hibernate user and really want to migrate to Cayenne.

    My reasons to migrate are;
    - Cayenne seem to have distributed "shared" cache support integrated.
    I am developing multi-application that has separate struts and web
    services application contexts. Cayenne, as I understand uses Javagroups
    and you can configure it to have distributed cache.
    With hibernate you have to use 3rd party cache (OSCache) and configure
    it additionally.
    - Easier higher-level syntax. In Hibernate you have make more
    unnecessary method calls.
    - Better community. Hibernate forums are full of two types of users-
    total beginners or snobs who reply only if your problem look like a bug
    in hibernate.

    I have a question about Cayenne key generation;
    - Can I use Hilo-type key id generator with Cayenne?
    According to chapter 4.7 Cayenne has "generated by Cayenne", provided by
    database, derived.
    In Hibernate you have a big choice of generators, you can use hilo,
    uuid, increment, etc.

    I need to have portable key id generation. Portable to other DB and API.
    In past, I have achieved it (with Hibernate) by using hilo: for table
    "data", I have sequence table "data_seq" which have one field and one
    record. Then I set in Hibernate mapping: generator="hilo"
    table="data_seq". Hibernate increments and updates value in "data_seq"
    table. This works with any possible database and is perfectly portable
    to other APIs.

    Now with Cayenne I can't use native DB generators and auto_increment.
    I also don't want to use Cayenne's "Generate Primary Key Support"
    (Chapter 4.6) which uses special table and therefore it's
    Cayenne-specific and not transparently portable to other API.

    Is there a way that I am missing?

    Thank you.
    Roman.



    This archive was generated by hypermail 2.0.0 : Wed Feb 23 2005 - 14:04:14 EST