Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Help with association mapping in Hibernate

 
Rafael Medina
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello...

Can somebody please tell me how to create an association for two tables that need to be joined like substr(table1.field1,4,10) = table2.field1


How can I define that association in Hibernate..?
 
Franck McGeough
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried putting your substr stuff in as a formula in your mapping to materialize a column and then join on that? It'd obviously be much better if something that you're using as a foreign key was a separate column. It seems like getting the association going is just the start of the issues.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!