how to check if record exists in DB table?
@Query(value = "select count(1) from my_tablewhere transaction_id= :transactionId",nativeQuery = true)
boolean existsByTransactionId(@Param("transactionId") String transactionId);
@Query(value = "select count(1) from my_tablewhere transaction_id= :transactionId",nativeQuery = true)
boolean existsByTransactionId(@Param("transactionId") String transactionId);
service deletes DB records, but i still get `No results were returned by the query`
apache Mina sshd
How do I use UserDetailsService properly? Where do I define it exactly?
Spring app doesn't read environmental variables from .env
RestApi Access Problem
Spring Boot Security / Request = 500
why use Optional<MyClass> if you cant call any methods that MyClass has?
Optional<Payment> earlierPayment=paymentRepository.findByTransactionIdAndAmount(paymentConfirmationRequest.getTransactionId(), paymentConfirmationRequest.getAmount());
.
and for some reason i cant call any getters that my Payment
entity has. does it mean that id need to change the return type of findByTransactionIdAndAmount
from Optional<Payment>
to just Payment
? and then id loose the advantage Optional
gives me. that doesnt make any sense 😦
any help? thanks...how to convert long to int
int4
? why not date
or datetime
?
3. in java code i see that my entity is private Long orderTime
, so does that mean theres a mistake in the code and i need to use Long in the database too? or do i use int in my Java code?
...Mocking fails for some reason
dependency isnt injected into my service
Failing test under misterious circumstances
Trying to load a Font from resources throws a BufferUnderflowException
some help needed with fixing circular dependencies
do i need to return DTO from my controller when handling errors?
RestResponseEntityExceptionHandler
. it looks like this:
```java
@ControllerAdvice
@Slf4j
public class RestResponseEntityExceptionHandler extends ResponseEntityExceptionHandler {...Spring Boot Microservices with JWT Issues
Help with Lombok
Spring Boot @Mapping gives no read accessor error
how to properly handle case when theres no records in the db table?