Group
Members
Repository
The GroupMembersRepository
interface
is useful to manage the queries for the members of the groups
Author
N7ghtm4r3 - Tecknobit
See also
JpaRepository
Functions
Link copied to clipboard
@Modifying(clearAutomatically = true
)
@Query(value = ""UPDATE " + GROUP_MEMBERS_TABLE + " SET " + INVITATION_STATUS_KEY + "=" + "'JOINED'"
+ " WHERE " + GROUP_MEMBER_KEY + "=:" + GROUP_MEMBER_KEY
+ " AND " + IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY",
nativeQuery = true
)
Method to execute the query to accept a
group invitation
Link copied to clipboard
@Modifying(clearAutomatically = true
)
@Query(value = ""UPDATE " + GROUP_MEMBERS_TABLE + " SET " + EMAIL_KEY + "=:" + EMAIL_KEY + " WHERE "
+ IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY",
nativeQuery = true
)
Method to execute the query to change the
user's email
Link copied to clipboard
@Modifying(clearAutomatically = true
)
@Query(value = ""UPDATE " + GROUP_MEMBERS_TABLE + " SET " + MEMBER_ROLE_KEY + "="
+ ":#{#" + MEMBER_ROLE_KEY + ".name()}"
+ " WHERE " + GROUP_MEMBER_KEY + "=:" + GROUP_MEMBER_KEY
+ " AND " + IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY",
nativeQuery = true
)
Method to execute the query to change the
role of a group member
Link copied to clipboard
@Modifying(clearAutomatically = true
)
@Query(value = ""UPDATE " + GROUP_MEMBERS_TABLE + " SET " + PROFILE_PIC_KEY + "=:" + PROFILE_PIC_KEY + " WHERE "
+ IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY",
nativeQuery = true
)
Method to execute the query to change the
user's profile pic
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@Modifying(clearAutomatically = true
)
@Query(value = ""DELETE FROM " + GROUP_MEMBERS_TABLE + " WHERE " + IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY",
nativeQuery = true
)
Method to execute the query to delete the
user's account
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@Query(value = ""SELECT * FROM " + GROUP_MEMBERS_TABLE + " WHERE " + GROUP_MEMBER_KEY + "=:" + GROUP_MEMBER_KEY",
nativeQuery = true
)
Method to execute the query to select the
members of a group
Link copied to clipboard
@Query(value = ""SELECT * FROM " + GROUP_MEMBERS_TABLE + " WHERE " + IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY
+ " AND " + GROUP_MEMBER_KEY + "=:" + GROUP_MEMBER_KEY",
nativeQuery = true
)
Method to execute the query to select a GroupMember
by its id
Link copied to clipboard
@Query(value = ""SELECT * FROM " + GROUP_MEMBERS_TABLE + " WHERE " + EMAIL_KEY + "=:" + EMAIL_KEY
+ " AND " + GROUP_MEMBER_KEY + "=:" + GROUP_MEMBER_KEY + " AND " + IDENTIFIER_KEY + "=:"
+ IDENTIFIER_KEY",
nativeQuery = true
)
Method to execute the query to select a GroupMember
by its email
Link copied to clipboard
@Query(value = "SELECT * FROM " + GROUP_MEMBERS_TABLE + " WHERE " + GROUP_MEMBER_KEY + "=:" + GROUP_MEMBER_KEY
+ " AND " + INVITATION_STATUS_KEY + " = 'JOINED'",
nativeQuery = true
)
Method to execute the query to select the
members of a group
Link copied to clipboard
Link copied to clipboard
@Modifying(clearAutomatically = true
)
@Query(value = "INSERT IGNORE INTO " + GROUP_MEMBERS_TABLE
+ "( "
+ IDENTIFIER_KEY + ","
+ NAME_KEY + ","
+ EMAIL_KEY + ","
+ PROFILE_PIC_KEY + ","
+ SURNAME_KEY + ","
+ MEMBER_ROLE_KEY + ","
+ INVITATION_STATUS_KEY + ","
+ GROUP_MEMBER_KEY + ") VALUES "
+ "( "
+ ":" + IDENTIFIER_KEY + ","
+ ":" + NAME_KEY + ","
+ ":" + EMAIL_KEY + ","
+ ":" + PROFILE_PIC_KEY + ","
+ ":" + SURNAME_KEY + ","
+ ":#{#" + MEMBER_ROLE_KEY + ".name()},"
+ ":#{#" + INVITATION_STATUS_KEY + ".name()},"
+ ":" + GROUP_MEMBER_KEY + ")",
nativeQuery = true
)
Method to execute the query to add a member
in a
com.tecknobit.pandoro.services.groups.entity.Group
Link copied to clipboard
@Modifying(clearAutomatically = true
)
@Query(value = ""DELETE FROM " + GROUP_MEMBERS_TABLE + " WHERE " + GROUP_MEMBER_KEY + "=:" + GROUP_MEMBER_KEY
+ " AND " + IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY",
nativeQuery = true
)
Method to execute the query to leave from a
group
Link copied to clipboard
Link copied to clipboard