I've got the following annotation for the Money member of a Product entity:
This is the Money class (ommitted members):Code:@Type(type="com.company.project.dao.usertype.MoneyUserType") @Columns(columns = { @Column(name="price"), @Column(name="currency") }) private Money price;
The problem is that the SQL generated from Hibernate doesn't contain the "price" column, but instead wants to retrieve data from the "amount" column.Code:@Embeddable public final class Money implements Serializable { public Money(BigDecimal amount, Currency currency) { this.amount = amount; this.currency = currency; }
I don't understand why this is happening? What did I do wrong?


Reply With Quote