Question
The select query given below from hibernate has an error like : Basic paths cannot be dereferenced SELECT b from book b inner join b.tags
The select query given below from hibernate has an error like : Basic paths cannot be dereferenced
"SELECT b from book b inner join b.tags t on b.id = t.b__id " from class book using @ElementCollection.
I am not able to make reference to Collection table book_tag and select the data from book table
where book.java is as given below
@Entity @Table(name = "book") // POJO class public class book { @Id @Column(name = "bookId") public int id; @Column(name = "bookName") public String bookName; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getBookName() { return bookName; } public void setBookName(String bookName) { this.bookName = bookName; } @ElementCollection (targetClass =String.class,fetch = FetchType.LAZY) @CollectionTable(name = "book_tag", joinColumns = @JoinColumn(name = "b__id") ) @Column(name = "b_tag") private Set
I am posting this question 3rd time so the person who whose hibernate and HQL please answer other wise please dont answer it.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started