Access Many-Many relationship attributes

I have created two entities named branch and cloth, and the relationship between them is many-many, now I have provided two different views one for admin and a very limited view for the user, but while creating user view, I need to access the attribute of that many-many relationship table but I am not getting the access to that table. So How can I access the attribute of the automatically created many-many relationship table.

Thank You!

We will be able to help you if you send us a small sample project along with reproduction scenario that demonstrates the issue.

I am sorry, I cannot share my sample project with you as it is confidential, but let me try to explain you the whole scenario that what actually I am trying to do.

I have created two entities, following are the details of both the entities:

  1. Branch:

    branchode            String                                BRANCHODE
    location             String                                LOCATION
    contact              String                                CONTACT
    retailer             Retailer [ammsnew$Retailer]           RETAILER_ID
    clotheses            Clothes [ammsnew$Clothes]
  2. Clothes:

    ageGroup             String                                   AGE_GROUP
    category             Category [ammsnew$Category]              CATEGORY_ID
    admin                Admin [ammsnew$Admin]                    ADMIN_ID
    branch               Branch [ammsnew$Branch]             
    model                FileDescriptor [sys$FileDescriptor]       MODEL_ID
    status               Boolean                                   STATUS

And I set the M-N relationship between these two entities and in a result Cuba Platform automatically generated a new table named “AMMSNEW_CLOTHES_BRANCH_LINK”.

In “Clothes” Entity, following information is available related to table “AMMSNEW_CLOTHES_BRANCH_LINK”:

Join Column: CLOTHES_ID
Inverse Join Column: BRANCH_ID

Similarly, In “Branch” Entity, following information is available related to table “AMMSNEW_CLOTHES_BRANCH_LINK”:

Join Column: BRANCH_ID
Inverse Join Column: CLOTHES_ID

Now I am providing different views to different users in which I have to show clothes which are related to a particular branch, to achieve this, I need to access the automatically generated table named “AMMSNEW_CLOTHES_BRANCH_LINK”, but I am unable to access the attributes of this table.
So can you please tell me that is there any way to access the attributes of auto generated table “AMMSNEW_CLOTHES_BRANCH_LINK”.

Please, create the view for the Branch entity as it is shown in the picture and add the many-to-many relation to this view:

After that these referenced entities will be loaded from the database and you will be able to access them either using JPQL or Java code. You don’t need to access the auto-generated table.

Actually I am trying to create roles and access groups and when I am applying constraints on it, there I need that attributes. Below is the screen shot of this:


This is where I actually need the Branch_ID.

For this purpose you should use the member of JPQL operator (see the example here).

Or if you want to display two related tables (Master - Details) you should use query parameters