crista wrote:
But if I use generator-class="native" like an such solution and I have to specify the sequence name, this is not an db independent solution because if I switch to another db I have to change the mapping.
I fail to understand where we disagree. I define
Code:
<param name="sequence">sq_x</param>
and then I know that on any database that supports sequences Hibernate will use
sq_x to generate the id.
On a database supporting identity, it will ignore the sequence settings and generate the id using identity. So I can work on both type of databases without change to the mapping. That's how I understand db independence. It's a fact - and this is probably what you mean - that the mapping is not totally neutral and that Hibernate doesn't do all the work for us.
Maybe we should simply agree on the fact that we disagree :-), but it seems to be the way Hibernate supports db independence - though it doesn't deserve this name in your opinion.
Erik