-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Comparing an entity's collection with user input
PostPosted: Sat Jul 28, 2007 11:06 pm 
Newbie

Joined: Sat Jul 28, 2007 10:47 pm
Posts: 1
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:


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 29, 2007 9:01 pm 
Newbie

Joined: Sat Jul 14, 2007 6:02 pm
Posts: 8
Why not create a custom query and filter on the input from the user, return as a list ?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.