131 questions
0
votes
0
answers
62
views
Eclipse Javadoc generation for Java records still incomplete?
It seems Eclipse still doesn't generate full Javadoc templates for records — or am I missing something?
I'm using Eclipse 2025-06 with Java 21.
When I type /** above a record, Eclipse only completes ...
1
vote
2
answers
167
views
How do I set a final hashcode value in a Java Record
For immutable classes, I like to set the hashCode value when the object is constructed. (I sometimes do this for the toString value too.) I want to do this in a Record as well. For example, I have a ...
1
vote
0
answers
114
views
BeanUtils getProperty not working for record
If my object is a record this is not working :
value = BeanUtils.getProperty(object, property);
I guess it is looking for a getter which does not exist.
Is there an alternative for java 17, that will ...
1
vote
1
answer
1k
views
Why is JPA still working with record class as entity?
Based on all the documentation I have read the following code should not work;Java records are immuatble and would not work with JPA. However the following code works. I can succesfully retrieve data ...
0
votes
0
answers
212
views
Spring Boot 3 Java record RequestBody camel case not filled properly
Since updating to Spring Boot 3, Java record RequestBody behaves strangely.
While this is filled properly from json request:
public record ExampleRequestDto(@JsonProperty("exampleData") ...
1
vote
1
answer
7k
views
Java records does not have default builder
Java came with records which are really useful and can avoid use of library like Project Lombok. But can someone please help me understand why records does not support Builder pattern by default? I ...
0
votes
0
answers
786
views
com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type `java.lang.Character` from Object value
I'n new in Java and I'm having this error deserializing a JSON to a Java record.
This is my record:
imports...
@JsonIgnoreProperties(ignoreUnknown = true)
public record Character(
@JsonAlias(&...
2
votes
1
answer
1k
views
How can I use Jackson's @JsonAnySetter with a record class?
I'm trying to use Jackson's feature to deserialize unknown fields into a map, using @JsonAnySetter. This works fine for a Java class with the field annotated with @JsonAnySetter, but does not work ...
0
votes
2
answers
1k
views
Local Record with type of generic method [closed]
Why is not possible to create a local record that contains fields corresponding to the generic type of the method?
Not working example:
public class Test {
<T> void foo(T param) {
...
0
votes
1
answer
2k
views
Java 17 Record and ConfigurationProperties are not working
I hope is there someone who could help me to understand this error.
My problem
I have a problem usign Record with @ConfigurationProperties:
when I start the application I get this error:
Caused by: ...
1
vote
2
answers
1k
views
Composition problem with Java Record canonical constructor
I want to use composition pattern and create a record from another record type in Java but I have some problems with the usage, maybe I am misusing the record in Java, could you please guide me, how ...
1
vote
0
answers
2k
views
Java 21 ObjectMapper not working with Records
I am using Java 21, and trying to convert a String from a REST response to a record. However, I am getting an error:
org.testcontainers.shaded.com.fasterxml.jackson.databind.JsonMappingException: Can ...
0
votes
1
answer
705
views
How to translate HttpResponse JSON to Java 17 record directly
I am sending a HTTP REST GET request to an API with standard Java 17 like this :
HttpResponse<String> response = httpClient.send(request, BodyHandlers.ofString());
and I can see the with ...
6
votes
2
answers
173
views
How to populate a JavaFX TableView with data using Java Record with Data from a Database
Short Question: What is the best way to populate a Java FX table view with data from a database by using a record? (rather than a typical object class with getters and setters)
Full question:
I have ...
24
votes
1
answer
6k
views
Are records syntactic sugar for classes?
I recently discovered Java records, and it was amazing to learn about their existence and purpose.
However, I began to wonder if they are essentially just classes behind the scenes.
Does this mean ...