#Spring Boot JPA Error: “Inferred type ‘S’ for type parameter ‘S’ is not within its bound ..

1 messages · Page 1 of 1 (latest)

ebon coyote
#

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

last bayBOT
#

<@&1004656351647117403> please have a look, thanks.

young scroll
#

records arent supported by jpa no?

ebon coyote
young scroll
#

looks like gpt code, could you share the whole thing please

ebon coyote
#

ok

#

im new to intellj do u know how to share a file?

young scroll
#

you copy paste your code with proper formatting

#
IO.println("hello"); 
ebon coyote
last bayBOT
# ebon coyote

I uploaded your attachments as Gist. This makes them more accessible, for example to mobile users.

ebon coyote
#

what im trying to do is

#

a user can create domains and a user can make records for a domain

young scroll
#

isn't Record a reserved type, or did you make one of your own

ebon coyote
#

wanna see record repository?

ebon coyote
#

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

young scroll
#

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

ebon coyote
#

ill try to change the name of the class

young scroll
#

Then see if you still get the error?

rough forge
#

The java.lang package is implicitly imported. Naming your type the same as a type in java.lang is a bad idea.

ebon coyote
#

im still getting the same error

young scroll
#

paste the code for this class and your entitiy

ebon coyote
last bayBOT
# ebon coyote

I uploaded your attachments as Gist. This makes them more accessible, for example to mobile users.

ebon coyote
last bayBOT
ebon coyote
#

oh i just fixed it

#

its because i didnt annotate my enitity class with @Entity

rough forge
#

It's the repositories signature that isn't satisfied. So what does the repo look like?