hibernate.jpa.criteria.BasicPathUsageException: Cannot join to attribute of basic type
I have two tables: Tax and TaxRule . There is one column same in both table i.e TAX_RULE_ID . But don't have any Hibernate mapping like OneToOne or OneToMany . Both table looks like- TAX @Id @Column(name = "TAX_RATE_ID") private Long taxRateId; @Column(name = "TAX_RULE_ID") private Long taxRuleId; @Column(name = "TAX_TYPE") private String taxType; TAX_RULE @Id @Column(name = "TAX_RULE_ID") private Long taxRuleId; @Column(name = "TAX_CD") private String TaxCode; @Column(name = "STATE") private String state; I am trying to fetch data on the key i.e TAX_RULE_ID . This column is common in both