Hi all,
I have been struggling on getting some stuff to work from today morning. No luck :( ... So, i was wondering if someone could help me here.
I have a class named Product.
Code:
class Product {
// id, version and other fields are declared here
@Column(name = "characteristics")
@CollectionOfElements
@JoinTable(name = "property_characteristics",
joinColumns = @JoinColumn(name = "product_id"))
private List<String> characteristics;
}
This entity is mapped to a table called "product" and the list of characteristics is mapped to a table called "property_characteristics" as shown above. So, based on the mapping each product will have multiple characteristics.
Now, i have a user input, in which the user enters multiple characteristics to search for products. I want to find all the products that match the list of characteristics specified by the user.
Is there a easy way to do this? I would really appreciate any help.
Thanks
Ganesh.
Code: