From: <bc...@pv...> - 2001-06-23 22:12:01
|
On Sat, Jun 23, 2001 at 11:25:32AM -0700, Konstantin Priblouda wrote: > > > This interests me. I will be doing a project where I > > don't care much > > what the primary keys are, only that they are there > > and are unique > > (obviously). Ideally, I would have the database > > autogenerate a > > sequence of numbers, but there doesn't seem to be a > > way to get the > > Container to do this for me? > > Using database for it seems messy for me - you insert > the row, and everything is fine (assumed your sequence > or autonumbering worked), but getting this ID out of > database is not convenient (and highly database > dependent). That's why I prefer to use separate bean > to generate ID's I seem to vaguely recall from when I used MS Access years ago that it had a special value type for auto-counter coloumns. You'd just define a coloumn and set it as a counter and everything happened automatically. It's something like this I'd want. It seems to me that this is a common thing to want to do and the database manager doing it would presumably be a lot more effecient than the application doing so. > > > Could you describe your sequence generator? It > > sounds like the thing > > that I need. > > I posted archive with complete source a week ago on > the list (look in the archive). There is also ejbutil > project on sourceforge > ( they also have something like this ) Thanks. Cheers Bent D -- Bent Dalager - bc...@pv... - http://www.pvv.org/~bcd powered by emacs |