Generate unique account number

From: JR Ruggentaler (JR.Ruggentale..pv.com)
Date: Sat Jan 15 2005 - 15:24:35 EST

  • Next message: Eric Schneider: "Re: Generate unique account number"

    I would like to generate a unique account number using Cayenne and MySQL. This would be similar to the Cayenne primary key generation and as SAFE. The account number would be a BIGINT MySQL type. How would I Model this and how would I get the next unique account number using Cayenne APIs? The account number would be similar to a credit card number (16 digits) and I DON'T want to use the Entity's primary key as the account number.

    My idea of how this would work in SQL is:

    Begin transaction:
    UPDATE tablename SET NEXT_ACCOUNT_NUM=NEXT_ACCOUNT_NUM + 3;
    SELECT NEXT_ACCOUNT_NUM from tablename;
    End transaction:

    J.R.



    This archive was generated by hypermail 2.0.0 : Sat Jan 15 2005 - 15:24:37 EST