logo       

RE: Ejb3 - GeneratorType: msg#00004

Subject: RE: Ejb3 - GeneratorType
Hi Eivind, Wouter, 
I originally thought the same thing Wouter as far as the AUTO only being
an Integer or a Long, however that is not always the case.  I do have
one test application that uses the 'GUID' pattern where the
auto-generated (although application-supplied in this scenario) key is
actually a String.  GUID is something like the server name, the time,
and the network address hashed together in a 32-bit char, can't remember
exactly, but is a use-case for GENERATOR-type that is a String.

Having said that, the GUID pattern is probably a new GENERATOR type not
yet defined and does not match the definitions provided for these types
(including the AUTO type):

http://www.caucho.com/resin-3.0/ejb3/cmp-table.xtp

* NONE - no auto generation for this field
* IDENTITY - the database supplies the new key, e.g. auto_increment,
SERIAL, or IDENTITY
* SEQUENCE - use a SEQUENCE type to generate the key
* TABLE - use a @TableGenerator for the key
* AUTO - choose the generator based on the database
   o MySQL - IDENTITY using auto_increment
   o Resin - IDENTITY using auto_increment
   o Postgres - SEQUENCE
   o Oracle - SEQUENCE 

So, from a more educated standpoint, AUTO is designed to be underneath
only IDENTITY/SEQUENCE, so yes, AUTO *should* only work if the field is
an Integer/Long (unless SEQUENCE can also handle others).

Regardless, is there something I can put in the preference file to set
the per-table generator to NONE? If not, I'll start poking around to
figure it out and commit it back.

-D



> Hey,
> 
> I'll be adding functionality to choose generator type for 
> each table. From the spec, the available types are these 5:
> 
> public enum GeneratorType { TABLE, SEQUENCE, IDENTITY, AUTO, NONE };
> 
> Right now it's hardcoded with the AUTO option.
> 
> Cannot String primary keys be auto-generated? Guess we could 
> make that a default option?
> 
> Generator type will be available i the GUI and preferences. 
> I'll try to get a first version out during this week.
> 
> .eivindw
> 
> > Yes,
> >
> > Modify the velocity template to only generate this XDoclet tag when 
> > the primairy key is either a Long or Interger. That is the way its 
> > supposed to be anyways imho :)
> >
> > Regards, wouter
> >


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
qnx.openqnx.dev...    politics.lenini...    audio.emagic.ex...    tex.texinfo.gen...    handhelds.linux...    ietf.sipping/20...    lang.erlang.gen...    cygwin.talk/200...    yellowdog.gener...    mozilla.devel.l...    xfree86.newbie/...    openbsd.ports/2...    db.oracle.devel...    kde.kalyxo.deve...    user-groups.lin...    bbc.cvs/2003-04...    gnu.libtool.bug...    redhat.k12osn/2...    emulators.wine....    freebsd.devel.d...    search.xapian.g...    java.izpack.use...    network.mrtg.us...    windows.total-c...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe