I'm using Hibernate's JPA impl to model some tables. I'm having trouble mapping a table that:
- Has no primary key
- Has a unique index on 4 columns, 3 of which can be nullable
I tried to hack it and define the index as a composite Id, but since some columns are nullable this is not working properly. Is this possible with JPA/Hibernate?
Thanks
A work arround is... You should implements your own UserType implementation and treats the null value to return a representative Object for this.
Look my example. The field is a nullable numeric, so my implementation is:
Looks like in HBM file:
...In Java:
}