I have 2 classes viz. Product and ProductBasic which has one-to-one relationship.
Product is mapped to a table PRODUCT which has PRODUCTID as PK.
ProductBasic is mapped to a table PRODUCTBASIC which has PRODUCTID,USETYPE and STARTTTIMESTAMP as composite key. Also PRODUCTID
is the foreign key referencing PRODUCT table...
When i am saving Product (with cascade for ProductBasic):
For Product, it's taking persister.identifierType as org.hibernate.type.CustomType
For ProductBasic, it's taking persister.identifierType as org.hibernate.type.ComponentType
When i call session.save(product),
a) For Product: it tries to find hashmap of id=1 using org.hibernate.type.StringType.getHashCode() which comes out to be 49 (ASCII)..
b) For ProductBasic: it tries to find hashmap of id=1 using org.hibernate.type.ComponentType.getHashCode() and throws exception:
org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of com.tietoenator.lis.db.impl.product.bo.CompProductBasicBO.useType
Does it treating ProductBasic as component because it's productId value depends upon Product.productId? Even if it treats
ProductBasic as component, why it is not fetching the proper hashCode() and throwing exception?