Reputation: 1888
I am using Hibernate 3.5.4
version as Orm I have two tables which have many to one relationship , Like Table 'Book' can have many 'Authors' associated with It.
@OneToMany(mappedBy = "key.bookId", fetch = FetchType.EAGER, cascade = CascadeType.ALL)
public Set<BookAuthor> getAuthors() {
return authors;
}
But we use soft delete for deleting the association (we maintain a column named isDeleted
) , i want to fetch the entity based on isDeleted
check if its 1 it should not be loaded , else if 0 load it.
Is it possible by modifying this current fetching strategy to provide above support or there is another better solution that can be applied please let me know.
Upvotes: 1
Views: 374