문제

Here is what I am doing: Their is table MEDIA against this their are multiple entries in MEDIA_TAGS table. So based on some user input for media tags I have to fetch the MEDIA table records. So here I have to join the tables MEDIA and MEDIA_TAGS only when their is input for the media tags.

Since it is legacy system I cant modify the existing mapping in hbm file. I wanted to know if their is any functionality in Hibernate to add the join on some another table based on certain condition or dynamic input.

Does this possible with predefined filters or is their any way to achieve this in hibernate mapping. Any pointers on this greatly help me.

도움이 되었습니까?

해결책

I used hibernate criteria.createAlias(.. to solve this problem.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top