-
Dec 3rd, 2011, 07:53 PM
#1
GWT App Engine problem with MEMBER OF
I'm using Spring ROO with GWT and App Engine for my new project and so far the technology is great!
But I encountered a problem last week.
I have these two entities: Item and ItemCategory.
@RooJavaBean
@RooToString
public class ItemCategory {
private String name;
}
@RooJavaBean
@RooToString
public class ItemCategory {
@ManyToMany(cascade = CascadeType.ALL)
private Set<ItemCategory> categories = new HashSet<ItemCategory>();
}
And then I made the custom finder to search for items that contains a specific category :
@SuppressWarnings("unchecked")
@Transactional
public static List<Item> Item.findByCategory(ItemCategory category) {
Query q = Item.entityManager().createQuery("SELECT o FROM Item AS o WHERE :category MEMBER OF o.categories").setParameter("category", category);
return q.getResultList();
}
But it returned me the following error :
Server Error: Field "categories" does not exist in com.test.intranet.Item or is not persistent;
Anyone know how to solve this problem?
Thank you very much.
-
Dec 3rd, 2011, 08:18 PM
#2
categories is stored as categoriesKeys
Ok I found out that the member categories is stored as categoriesKeys in the Datastore.
So I tried "SELECT o FROM Item AS o WHERE :category MEMBER OF o.categoriesKeys" but sadly it gives me this error:
Server Error: Illegal argument; nested exception is javax.persistence.PersistenceException: Illegal argument
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules