Does createAlias chaining require that all domain objects down the chain have same id types
I have this in the code
Code:
crit.createAlias("claim", "cl")
.createAlias("cl.episode", "ep")
.createAlias("ep.referral", "rf")
.createAlias("rf.patient", "pt")
.createAlias("pt.person", "per");
org.hibernate.TypeMismatchException exception is thrown with the message Provided id of the wrong type. Expected: class java.lang.Long, got class java.lang.Integer when crit.list(); method is called.
When I commented out:
Code:
crit.createAlias("claim", "cl")
.createAlias("cl.episode", "ep")
.createAlias("ep.referral", "rf")
.createAlias("rf.patient", "pt")
.createAlias("pt.person", "per");
no exception is thrown.
When I have it thus
Code:
crit.createAlias("claim", "cl")
.createAlias("cl.episode", "ep");
//.createAlias("ep.referral", "rf")
//.createAlias("rf.patient", "pt")
// .createAlias("pt.person", "per");
It worked, however with this:
Code:
crit.createAlias("claim", "cl")
.createAlias("cl.episode", "ep")
.createAlias("ep.referral", "rf");
//.createAlias("rf.patient", "pt")
// .createAlias("pt.person", "per");
The id types of the domains
Remittance - Long
Claim - Long
Episode - Integer
Referral - Integer
Patient - Integer
Person - Integer.