Updated Code
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
package net.gepafin.tendermanagement.repositories;
|
||||
|
||||
import net.gepafin.tendermanagement.entities.CommunicationAmendmentEntity;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
public interface CommunicationAmendmentRepository extends JpaRepository<CommunicationAmendmentEntity, Long> {
|
||||
|
||||
@Query("Select c from CommunicationAmendmentEntity c Where c.id = :id")
|
||||
CommunicationAmendmentEntity findCommentsById(@Param("id") Long id);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package net.gepafin.tendermanagement.repositories;
|
||||
|
||||
import net.gepafin.tendermanagement.entities.CommunicationEntity;
|
||||
import net.gepafin.tendermanagement.model.response.CommunicationResponseBean;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CommunicationRepository extends JpaRepository<CommunicationEntity, Long> {
|
||||
|
||||
@Query("Select c from CommunicationEntity c Where c.id = :id")
|
||||
CommunicationEntity findCommentsById(@Param("id") Long id);
|
||||
|
||||
@Query("SELECT new net.gepafin.tendermanagement.model.response.CommunicationResponseBean( " + "c.addedDate, c.communicationComment, c.communicationTitle, c.createdDate, c" +
|
||||
".updatedDate, c.amendmentRequest.id) " + "FROM CommunicationEntity c " + "WHERE c.amendmentRequest.id = :amendmentId AND c.isDeleted = false")
|
||||
List<CommunicationResponseBean> findCommentDetailsByAmendmentId(@Param("amendmentId") Long amendmentId);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user