2021-07-26 12:10:54.197 INFO 19876 --- [ionShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2021-07-26 12:10:54.197 INFO 19876 --- [ionShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
@Service
public class OperationBdServiceImpl implements OperationBdService{
@Override
public void updateTransactionSucess(String guia, String contrato, String numeroPago, String codigo,
String fecha) {
operationRepository.updateTransaction(guia, contrato, numeroPago, codigo, fecha);
}
}
@Service
public class OperationBdServiceImpl implements OperationBdService{
@Override
public void updateTransactionSucess(String guia, String contrato, String numeroPago, String codigo,
String fecha) {
operationRepository.updateTransaction(guia, contrato, numeroPago, codigo, fecha);
}
}
@Repository
public interface OperationRepository extends JpaRepository<Dto, Integer> {
@Modifying(clearAutomatically = true)
@Transactional
@Query(value="UPDATE Dto t SET t.estatus='SUCCESS' WHERE t.guia=?1 AND t.contrato=?2 AND "
+ "t.numeroPago=?3"
+ "AND t.codigo=?4 AND t.fecha=?5 AND t.estatus='PENDIENTE'", nativeQuery = true)
void updateTransaction(String guia, String conntrato, String numeroPago, String codigo,
String fecha,);
}
@Repository
public interface OperationRepository extends JpaRepository<Dto, Integer> {
@Modifying(clearAutomatically = true)
@Transactional
@Query(value="UPDATE Dto t SET t.estatus='SUCCESS' WHERE t.guia=?1 AND t.contrato=?2 AND "
+ "t.numeroPago=?3"
+ "AND t.codigo=?4 AND t.fecha=?5 AND t.estatus='PENDIENTE'", nativeQuery = true)
void updateTransaction(String guia, String conntrato, String numeroPago, String codigo,
String fecha,);
}
@Entity
@Table(name="DTO")
public class Dto implements Serializable {
/**
*
*/
private static final long serialVersionUID = -5215215058728473440L;
@Id
@Column(name = "GUIA")
private String guia;
@Column(name = "NUM_CONTRATO")
private String contrato;
@Column(name = "NUM_PAGO")
private String numeroPago;
@Column(name = "CODIGO")
private String codigo;
@Column(name = "FECHA_REG")
private String fecha;
@Column(name = "ESTATUS")
private String estatus;
@Column(name = "MENSAJE")
private String mensaje;
}
@Entity
@Table(name="DTO")
public class Dto implements Serializable {
/**
*
*/
private static final long serialVersionUID = -5215215058728473440L;
@Id
@Column(name = "GUIA")
private String guia;
@Column(name = "NUM_CONTRATO")
private String contrato;
@Column(name = "NUM_PAGO")
private String numeroPago;
@Column(name = "CODIGO")
private String codigo;
@Column(name = "FECHA_REG")
private String fecha;
@Column(name = "ESTATUS")
private String estatus;
@Column(name = "MENSAJE")
private String mensaje;
}