I've confirmed that this only happens with an IdClass. This doesn't happen without an IdClass (which is non-JPA but allowed by Hibernate).