S
suatkaya74
Hi,
In my database, I've two entities which have many-to-many
relationships, that were connected by a third table, like the
following:
TABLE groups
(
group_id int primary key,
group_name varchar
.....
)
TABLE users
(
user_id int primary key,
user_name varchar
.....
)
TABLE group_membership
(
group_id int,
user_id int,
approved int,
)
I know that I can connect users and groups with @ManyToMany annotation
without having to define a group_membership entity. Now, I have 2
questions:
1. How can I represent the value of "approved" field of the
group_membership table?
2. Is there any way to filter out approved=0 members while defining the
collections in users and groups entities?
Regards,
Suat
In my database, I've two entities which have many-to-many
relationships, that were connected by a third table, like the
following:
TABLE groups
(
group_id int primary key,
group_name varchar
.....
)
TABLE users
(
user_id int primary key,
user_name varchar
.....
)
TABLE group_membership
(
group_id int,
user_id int,
approved int,
)
I know that I can connect users and groups with @ManyToMany annotation
without having to define a group_membership entity. Now, I have 2
questions:
1. How can I represent the value of "approved" field of the
group_membership table?
2. Is there any way to filter out approved=0 members while defining the
collections in users and groups entities?
Regards,
Suat