Updates
Repository
The UpdatesRepository
interface is
useful to manage the queries for the updates of a project
Author
N7ghtm4r3 - Tecknobit
See also
JpaRepository
Functions
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 " + UPDATES_KEY + " WHERE " + IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY",
nativeQuery = true
)
Method to execute the query to delete an
existing ProjectUpdate
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@Query(value = ""SELECT * FROM " + UPDATES_KEY + " WHERE " + PROJECT_KEY + "=:" + PROJECT_KEY
+ " AND " + IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY",
nativeQuery = true
)
Method to execute the query to select a ProjectUpdate
by its id
Link copied to clipboard
@Query(value = ""SELECT * FROM " + UPDATES_KEY + " WHERE " + PROJECT_KEY + "=:" + PROJECT_KEY
+ " AND " + UPDATE_TARGET_VERSION_KEY + "=:" + UPDATE_TARGET_VERSION_KEY",
nativeQuery = true
)
Method to execute the query to select a ProjectUpdate
by its target project_version
Link copied to clipboard
@Modifying(clearAutomatically = true
)
@Query(value = ""UPDATE " + UPDATES_KEY + " SET "
+ UPDATE_PUBLISH_DATE_KEY + "=:" + UPDATE_PUBLISH_DATE_KEY + ","
+ UPDATE_PUBLISHED_BY_KEY + "=:" + UPDATE_PUBLISHED_BY_KEY + ","
+ UPDATE_STATUS_KEY + "= 'PUBLISHED'"
+ " WHERE " + IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY",
nativeQuery = true
)
Method to execute the query to publish an
existing com.tecknobit.pandoro.services.projects.entities.ProjectUpdate
Link copied to clipboard
@Modifying(clearAutomatically = true
)
@Query(value = ""UPDATE " + UPDATES_KEY + " SET "
+ AUTHOR_KEY + "=NULL,"
+ UPDATE_STARTED_BY_KEY + "=NULL,"
+ UPDATE_PUBLISHED_BY_KEY + "=NULL"
+ " WHERE " + AUTHOR_KEY + "=:" + IDENTIFIER_KEY
+ " OR " + UPDATE_STARTED_BY_KEY + "=:" + IDENTIFIER_KEY
+ " OR " + UPDATE_PUBLISHED_BY_KEY + "=:" + IDENTIFIER_KEY",
nativeQuery = true
)
Method to execute the query to remove the
constraints between PandoroUser
deleted and ProjectUpdate
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@Modifying(clearAutomatically = true
)
@Query(value = "INSERT INTO " + UPDATES_KEY
+ "( "
+ IDENTIFIER_KEY + ","
+ UPDATE_TARGET_VERSION_KEY + ","
+ UPDATE_CREATE_DATE_KEY + ","
+ UPDATE_PUBLISH_DATE_KEY + ","
+ UPDATE_START_DATE_KEY + ","
+ UPDATE_STATUS_KEY + ","
+ PROJECT_KEY + ","
+ AUTHOR_KEY + ","
+ UPDATE_PUBLISHED_BY_KEY + ","
+ UPDATE_STARTED_BY_KEY + ") VALUES "
+ "( "
+ ":" + IDENTIFIER_KEY + ","
+ ":" + UPDATE_TARGET_VERSION_KEY + ","
+ ":" + UPDATE_CREATE_DATE_KEY + ","
+ "-1,"
+ "-1,"
+ ":#{#" + UPDATE_STATUS_KEY + ".name()},"
+ ":" + PROJECT_KEY + ","
+ ":" + AUTHOR_KEY + ","
+ "NULL,"
+ "NULL)",
nativeQuery = true
)
Method to execute the query to schedule a
new
ProjectUpdate
Link copied to clipboard
@Modifying(clearAutomatically = true
)
@Query(value = ""UPDATE " + UPDATES_KEY + " SET "
+ UPDATE_START_DATE_KEY + "=:" + UPDATE_START_DATE_KEY + ","
+ UPDATE_STARTED_BY_KEY + "=:" + UPDATE_STARTED_BY_KEY + ","
+ UPDATE_STATUS_KEY + "= 'IN_DEVELOPMENT'"
+ " WHERE " + IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY",
nativeQuery = true
)
Method to execute the query to start an
existing ProjectUpdate