Hi everybody,
I'm using Hibernate 2.2 with XDoclet to generate mapping files and sql-code for my Oracle 9 database. Now I want to define a unique key via XDoclet. To do so for a single property you have just to add:
Code:
@hibernate.property column="NAME" unique="true"
That works, no problems.
But how could I make two or more properties unique? For example I want the combination of "name" and "birthday" to appear only once in a table.
I tried with:
Code:
@hibernate.column unique-key="unique"
I thought that every column with the same unique-key would be included in a group of unique columns. But I get an Exception:
Code:
Schema text failed: java.lang.StringIndexOutOfBoundsException: String index out of range:0
Any suggestions what I did wrong? What should I change?
smo