circle
JCHJava Community | Help. Code. Learn.
•Created by circle on 11/16/2024 in #java-help
ResponseEntity incorrectly maps values
49 replies
JCHJava Community | Help. Code. Learn.
•Created by circle on 11/15/2024 in #java-help
Unable to catch MethodArgumentTypeMismatchException on doFilter()
I have a filter that basically logs incoming and outgoing information, but it seems that using this custom
RequestLoggingFilter implements Filter
creates a problem, I get MethodArgumentTypeMismatchException
when a request's URI is unmapped.
Error as follows:
I believe adding the non-existent URI "all" which I don't even map caused this problem. I find it weird since I could not catch the exception in:15 replies
JCHJava Community | Help. Code. Learn.
•Created by circle on 11/10/2024 in #java-help
Bypass SQLRestriction to achieve SoftDelete with "hard delete"
I have this entity:
30 replies
JCHJava Community | Help. Code. Learn.
•Created by circle on 11/9/2024 in #java-help
Populate Spring Data JPA before each @Test
I want to test my Products repository (or other tests that requires database to be populated first). I have tried using
ApplicationListener<ApplicationReadyEvent>
previously but even though (in the testing environment), the populating methods seem to have been run, the .save
methods called by them returns null for each data creation when populating.
My goal is to have the database bootstrapped with the data I have parsed from my CSV parser so it can be used as a Test resource. I have tried so many things, but yet none of them automatic populators work, for it to work, I have to manually populate the data explicitly before tests in the test environment.
The DataJpaTest:
45 replies
JCHJava Community | Help. Code. Learn.
•Created by circle on 10/27/2024 in #java-help
MapStruct updater not compiling properly
11 replies
JCHJava Community | Help. Code. Learn.
•Created by circle on 4/14/2024 in #java-help
Repository bean not found for service implementation
I'm new in spring boot, I came across this problem where I couldn't run the app
TLDR of the error:
I have tried debugging it, but I couldn't read and solve the problem, as I've reached with copilot to confirm whether or not I did this right, they even said my structure and annotations seem fine.
54 replies
JCHJava Community | Help. Code. Learn.
•Created by circle on 1/2/2024 in #java-help
Which methods are being used as an abstract method for functional interface?
6 replies
JCHJava Community | Help. Code. Learn.
•Created by circle on 1/2/2024 in #java-help
Make array container classes behave like ArrayList
How to make a class that contains a variable that stores an array able to return the inner element holder like
elementData
in ArrayList. For example when we want to iterate in enhanced for loop (var e : elements)
where elements
is an ArrayList , it somehow converts the elements to array to be iterated.
I couldn't find documentations online or find discussions about it. Using toArray doesn't seem to work17 replies
JCHJava Community | Help. Code. Learn.
•Created by circle on 5/25/2023 in #java-help
Object sequential searching using compareTo()
I have this simple method to search for an object that uses
Comparable
interface. But I'm wondering, why does my parameter should use extends
instead of implements
? Doesn't this break the law where an object can only extend ONE class, but is able to implement multiple interfaces? So why doesn't implements
work here?
27 replies
JCHJava Community | Help. Code. Learn.
•Created by circle on 10/30/2022 in #java-help
De-compiler assigning boolean value to int data type
22 replies