ProjectsRepository
The ProjectsRepository
interface is useful to manage the queries for the projects
Author
N7ghtm4r3 - Tecknobit
See also
JpaRepository
Functions
Link copied to clipboard
@Modifying(clearAutomatically = true)
@Query(value = "INSERT INTO " + PROJECTS_KEY +
" ("
+ IDENTIFIER_KEY + ","
+ LOGO_URL_KEY + ","
+ NAME_KEY + ","
+ AUTHOR_KEY + " )"
+ " VALUES ("
+ ":" + IDENTIFIER_KEY + ","
+ ":" + LOGO_URL_KEY + ","
+ ":" + NAME_KEY + ","
+ ":" + AUTHOR_KEY + ")", nativeQuery = true)
Method to execute the query to add a new Project
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 " + PROJECTS_KEY + " WHERE " + IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY", nativeQuery = true)
Method to execute the query to delete an existing Project
Link copied to clipboard
@Modifying(clearAutomatically = true)
@Query(value = ""UPDATE " + PROJECTS_KEY +
" SET "
+ NAME_KEY + "=:" + NAME_KEY +
" WHERE " + IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY", nativeQuery = true)
Method to execute the query to edit an existing Project
@Modifying(clearAutomatically = true)
@Query(value = ""UPDATE " + PROJECTS_KEY +
" SET " +
NAME_KEY + "=:" + NAME_KEY + "," +
LOGO_URL_KEY + "=:" + LOGO_URL_KEY +
" WHERE " + IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY", nativeQuery = true)
Method to execute the query to add an existing Project
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@Query(value = ""SELECT * FROM " + PROJECTS_KEY + " WHERE " + AUTHOR_KEY + "=:" + AUTHOR_KEY
+ " AND " + IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY
+ " UNION SELECT " + PROJECTS_KEY + ".* FROM " + PROJECTS_KEY + " AS " + PROJECTS_KEY
+ " INNER JOIN " + PROJECT_MEMBERS_TABLE + " AS " + PROJECT_MEMBERS_TABLE
+ " ON " + PROJECTS_KEY + "." + IDENTIFIER_KEY + "=" + PROJECT_MEMBERS_TABLE
+ "." + IDENTIFIER_KEY + " WHERE " + PROJECT_MEMBERS_TABLE + "." + MEMBER_IDENTIFIER_KEY
+ "=:" + AUTHOR_KEY + " AND " + PROJECTS_KEY + "." + IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY", nativeQuery = true)
Method to execute the query to get an existing Project if the user is authorized
Link copied to clipboard
@Query(value = ""SELECT " + PROJECTS_KEY + ".* FROM " + PROJECTS_KEY + " AS " + PROJECTS_KEY + " INNER JOIN "
+ PROJECT_MEMBERS_TABLE + " AS " + PROJECT_MEMBERS_TABLE + " ON " + PROJECTS_KEY + "."
+ IDENTIFIER_KEY + "=" + PROJECT_MEMBERS_TABLE + "." + IDENTIFIER_KEY + " WHERE "
+ MEMBER_IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY", nativeQuery = true)
Method to execute the query to get the list of Project where the user who made the request is a member
Link copied to clipboard
Link copied to clipboard
@Modifying(clearAutomatically = true)
@Query(value = "INSERT INTO " + PROJECT_MEMBERS_TABLE +
" ("
+ IDENTIFIER_KEY + ","
+ MEMBER_IDENTIFIER_KEY +
" )"
+ " VALUES ("
+ ":" + IDENTIFIER_KEY + ","
+ ":" + MEMBER_IDENTIFIER_KEY
+ ")", nativeQuery = true)
Method to execute the query to join a new member in an existing Project
Link copied to clipboard
@Modifying(clearAutomatically = true)
@Query(value = "INSERT INTO " + PROJECT_TESTERS_TABLE +
" ("
+ PROJECT_IDENTIFIER_KEY + ","
+ MEMBER_IDENTIFIER_KEY +
" )"
+ " VALUES ("
+ ":" + PROJECT_IDENTIFIER_KEY + ","
+ ":" + MEMBER_IDENTIFIER_KEY
+ ")", nativeQuery = true)
Method to execute the query to mark a member as Tester
Link copied to clipboard
@Modifying(clearAutomatically = true)
@Query(value = ""DELETE FROM " + PROJECT_MEMBERS_TABLE + " WHERE " + IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY", nativeQuery = true)
Method to execute the query to remove all the members from an existing Project
Link copied to clipboard
@Modifying(clearAutomatically = true)
@Query(value = ""DELETE FROM " + PROJECT_TESTERS_TABLE + " WHERE " + PROJECT_IDENTIFIER_KEY + "=:" + PROJECT_IDENTIFIER_KEY", nativeQuery = true)
Method to execute the query to remove all testers from a Project
Link copied to clipboard
@Modifying(clearAutomatically = true)
@Query(value = ""DELETE FROM " + PROJECT_MEMBERS_TABLE + " WHERE " + IDENTIFIER_KEY + "=:"
+ IDENTIFIER_KEY + " AND " + MEMBER_IDENTIFIER_KEY + "=:" + MEMBER_IDENTIFIER_KEY", nativeQuery = true)
Method to execute the query to remove a member from an existing Project
Link copied to clipboard
@Modifying(clearAutomatically = true)
@Query(value = ""DELETE FROM " + PROJECT_TESTERS_TABLE + " WHERE " + PROJECT_IDENTIFIER_KEY + "=:"
+ PROJECT_IDENTIFIER_KEY + " AND " + MEMBER_IDENTIFIER_KEY + "=:" + MEMBER_IDENTIFIER_KEY", nativeQuery = true)
Method to execute the query to remove a tester from an existing Project
Link copied to clipboard
Link copied to clipboard