im in service class im trying to save a record. i have an entity record and a record repository i wanna save a record enitity. but im having this weird error that shows it might mistaken my enitity to Java.Lang.Record but no because i clicked on it and it mapped to my record enitity. also i already imported the record entity and record repository and i injected the record repository
#Spring Boot JPA Error: “Inferred type ‘S’ for type parameter ‘S’ is not within its bound ..
1 messages · Page 1 of 1 (latest)
<@&1004656351647117403> please have a look, thanks.
records arent supported by jpa no?
its an enitity called record i made
looks like gpt code, could you share the whole thing please
I uploaded your attachments as Gist. This makes them more accessible, for example to mobile users.
what im trying to do is
a user can create domains and a user can make records for a domain
isn't Record a reserved type, or did you make one of your own
wanna see record repository?
i made my own
i made an entity record
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class Record {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Enumerated(EnumType.STRING)
private RecordType type;
private String name;
private String value;
@ManyToOne
@JoinColumn(name = "domain_id")
private Domain domain;
public Record(RecordType type, String name, String value, Domain domain) {
this.type = type;
this.name = name;
this.value = value;
this.domain = domain;
}
public Record() {}
}
this is my entity record
ok so first, its a really bad idea to name your class that
the error you see is related to this
java.land.Record
Use your IDE to rename that file to something like CustomRecords or something
ill try to change the name of the class
Then see if you still get the error?
The java.lang package is implicitly imported. Naming your type the same as a type in java.lang is a bad idea.
im still getting the same error
paste the code for this class and your entitiy
I uploaded your attachments as Gist. This makes them more accessible, for example to mobile users.
and this is the class entity
I uploaded your attachments as Gist. This makes them more accessible, for example to mobile users.
that one was my record service
oh i just fixed it
its because i didnt annotate my enitity class with @Entity
It's the repositories signature that isn't satisfied. So what does the repo look like?
ur right
i fixed it too