Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 tags; public void model(int id, String bookName, Set tags) { this.id = id; this.bookName= bookName; this.tags = tags; } public Set getTags() { return tags; } public void setTags(Set tags) { this.tags = tags; } public List getResultList() { // TODO Auto-generated method stub return null; } @Override public String toString() { return "Model [id=" + id + ", bookName=" + bookName + ", tags=" + tags + "]"; }

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Current Trends In Database Technology Edbt 2004 Workshops Edbt 2004 Workshops Phd Datax Pim P2panddb And Clustweb Heraklion Crete Greece March 2004 Revised Selected Papers Lncs 3268

Authors: Wolfgang Lindner ,Marco Mesiti ,Can Turker ,Yannis Tzitzikas ,Athena Vakali

2005th Edition

3540233059, 978-3540233053

More Books

Students also viewed these Databases questions

Question

How do heredity and the environment work togetherpg18

Answered: 1 week ago