gavin wrote:
Your schema makes zero sense. If you hae a UUID, it is by definition unique of its own accord. It is the primary key. You don't need another column.
Well, as I wrote in the beginning, it is a legacy DB, so I cannot change the schema, whether it make sense or not.
eagle79 wrote:
AFAIK, there is no database that allows two true primary keys in one table, either. You have to choose one of them (though the other can still be constrained unique)
This is true, and I did so. I just wondered whether I could use Hibernate to generate both ids, one as the primary key and one as a unique column. But there seems to be not possibility. By now I have found another solution, although I cannot use Hibernates abstraction from the underlying database anymore, which is the drawback of this solution.