sorin7486 wrote:
- is it really that necessary in every day work to have the ID generated before saving ?
when do you want it generated then ?
After insertion ? then you need "identity" or "select" id generator because an id is needed at some point; right ? :)
Quote:
do I really need to add an entity to any collections before saving it (as a hibernate constraint or something like that)?
this has nothing to do with id generation, at least not upfront. it is important to keep your java model consistent with what you have mapped it. so if it is a bidirectional relationship then you need to have it that way. if it is *not* a bidirectional relationship you don't need to put in a collection.
Quote:
- if this issue is so important how come there's so little stuff about it on the forum ?
because it is well documented in the docs and it normally makes sense to have an id for persistent objects ? :)
Quote:
i mean there are allot of threads about sequences or making composite ID generators (or something like that).. but I don't have support in MySQL for sequences (so the only choice I see is emulating that in some way) and so far I haven't found an example that's not based sequences and that is able to generate ID's before saving...
did you read the docs ? did you try other id generators than sequence ? e.g. hilo ?