I found a partial solution to this problem, where is what I did so far :
Added a many-to-one association pointing to the same table :
Code:
<many-to-one
name="ak1UserLogin"
class="UserHB"
insert="false"
update="false"
unique-key="login"
>
<column name="QUARTER" />
<column name="USER_LOGIN" />
</many-to-one>
This mapping generates the following DDL :
Code:
create table USER (QUARTER varchar(7) not null, USER_ID varchar(12) not null, USER_LOGIN varchar(80) not null, primary key (QUARTER, USER_ID), unique (QUARTER, USER_LOGIN))
So far so good, but the catch is that now it's also generating this alter table :
Code:
alter table USER add constraint FKEF82875CB55E62BC foreign key (QUARTER, USER_LOGIN) references USER
So it's creating a constraint pointing to QUARTER/USER_ID with QUARTER/USER_LOGIN which just locks the table completely :)
Anyway, it's a progress.
Anyone have any other idea ?