You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to access the categories of products
This is my approach Selection<ReactiveResult<ProductEntity>> productsSelection = mDataStore.select(ProductEntity.class); productsSelection.where(ProductEntity.OWNER.eq(merchantEntity)); productsSelection.where(ProductEntity.NAME.like(query)).or(ProductEntity.CATEGORY.like(query); productsSelection.where(ProductEntity.DELETED.notEqual(true));
This does not match the name of the category as I stated here productsSelection.where(ProductEntity.NAME.like(query)).or(ProductEntity.CATEGORY.like(query);
How can I go about getting the categories of a product as this is returning null
What is the right approach to getting data from many to one relationships?
The text was updated successfully, but these errors were encountered:
Question How can I query the categories of a product? I am trying to match the categories with the passed in the query.
Situation
I want to be able to search for categories of products.
I have two tables for this:
interface Product { @Bindable @ManyToOne ProductCategoryEntity getCategory(); }
and
interface ProductCategory { @OneToMany(mappedBy = "category", cascade = {CascadeAction.SAVE}) List<ProductEntity> getProducts(); }
I want to access the categories of products
This is my approach
Selection<ReactiveResult<ProductEntity>> productsSelection = mDataStore.select(ProductEntity.class); productsSelection.where(ProductEntity.OWNER.eq(merchantEntity)); productsSelection.where(ProductEntity.NAME.like(query)).or(ProductEntity.CATEGORY.like(query); productsSelection.where(ProductEntity.DELETED.notEqual(true));
This does not match the name of the category as I stated here
productsSelection.where(ProductEntity.NAME.like(query)).or(ProductEntity.CATEGORY.like(query);
How can I go about getting the categories of a product as this is returning null
What is the right approach to getting data from many to one relationships?
The text was updated successfully, but these errors were encountered: