Hello, all!

I have entity bean with attribute "id": Integer wich is primary key.
Catridge for ejb generate for me the following code:

    public java.lang.Integer ejbCreate (java.lang.double balance)
           throws javax.ejb.CreateException
    {

        String primaryKey = new java.rmi.server.UID().toString();
        setId (primaryKey);
        return null;  // should not return primaryKey for CMP: see EJB spec,
                      // chapter 10.5.2 "Bean ProviderТs entity bean instanceТs view"
    }

Questions:
1. In compile time I receive error on line:
        setId (primaryKey);
(it's obvious, because property "id" has Integer-type, but String)

2. but I have and another problem - I would like to use db-server (and app-server)  
vendor specific way for generation of primary key in case Integer or Long primary key. 
I mean, for example, sequences for Oracle or autoincrement engine for other db...
How I have to define this?

Thank you.

With best regards,
Maxim Petrashev

Sr. J2EE Developer
Database Technologies Department
LUXOFT,
IBS Group of Companies
http://www.luxoft.com



-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
Andromda-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/andromda-devel
  • ... Максим Петрашев
    • ... David Wann

Reply via email to